Currently I am doing a program using JSP. In that program I use JavaScript function "confirm". The problem is it appears twice although I only define it once. Do you have any ide what is wrong with it ? The portion of the coding is :
<%if(v_seq.size()==0) {%>
<script>
alert('No GDRN to be generated !');
window.close()
</script>
<%} else {%>
<script>
if(confirm("Are you sure you want to generate and print these GDRNs ?"
)
{
window.print()
location.href="mr_auto_gdrn_update.jsp"
}
else
{
window.close()
}
</script>
<%}%>
<%if(v_seq.size()==0) {%>
<script>
alert('No GDRN to be generated !');
window.close()
</script>
<%} else {%>
<script>
if(confirm("Are you sure you want to generate and print these GDRNs ?"
{
window.print()
location.href="mr_auto_gdrn_update.jsp"
}
else
{
window.close()
}
</script>
<%}%>