Thanks a lot!
Yes, it works fine now after removing } 🙂
But the continue button on that same page is not working.
echo "<div style='position:absolute; top:27.5%; right:50%; height:10em; margin-top:-5em;'>
<input type=button name='submitter' value='Continue' onclick=\"mySubmitFunction(this.form, ".$choice.",'".$_SESSION['custExisting']."','".$_SESSION['cr_card_exist_flag']."','".$_SESSION['ship_pymt_changed_flag']."')\"></div>";
even the document.write("hello") in mySubmitFunction is not getting displayed.
The following is mySubmitFunction
<script language="JavaScript" type="text/javascript">
<!--
function mySubmitFunction(which,choice,custExisting,cr_card_exist_flag,ship_pymt_changed_flag)
{document.write("hello");
if (ship_pymt_changed_flag=='true') //TO UPDATE SHIP_PYMT IF USER CLICKED <change payment> or <change shipping> links
if (custExisting=='No')//NEW CUST
{if (validate_form(which)==true);
{which.action="confirm.php";
which.submit();}
}
else //OLD CUST
{which.action="confirm.php";
which.submit();}
}
else
if (custExisting=='No')//NEW CUST
if (validate_form(which)==true)
if (choice==0) //BILLING ADDR IS NOT THE SAME AS SHIPPING ADDR
{which.action="shipping_addr.php";}
else
{which.action="confirm.php";}
which.submit();
else //OLD CUST
if (choice==2)
if (cr_card_exist_flag=='false') //FOR OLD CUSTOMERS WITH NO CREDIT_CARD RECORD
if (validate_form(which)==true)
{which.action="confirm.php";
which.submit();}
else
{error_box.innerHTML="Error in processing your details!";
error_box.className="messageYes";}
else //FOR OLD CUSTOMERS WITH CREDIT_CARD RECORD
{document.write("hello");
which.action="confirm.php";
which.submit();}
}
//-->
</script>