I needed to know how do I access the variables of the form when the form calls itself - <form name=myForm method=post action="<?php echo $PHP_SELF ?>"> if the input type is not "SUBMIT", but it is "BUTTON"?
To explain myself a little more clearly, here is the code:
<?php
if( $btnSave ) {
echo ("Save Clicked!");
}
else {
echo ("Save not clicked!");
}
?>
<head>
<script>
function validateForm()
{
if (document.myForm.myText == "" )
{
alert("Error in myText");
document.myForm.myText.focus();
}
else
{
document.myForm.submit();
}
}
</script>
</head>
<body>
<form name=myForm method="post" action="<?php echo $PHP_SELF ?>">
<input type="text" name="myText"><br>
<input type="button" name="btnSave" value="SAVE" onclick="validateForm();">
</form>
</body>
I am getting "Save not clicked" even if I have clicked on the SAVE button.
Please advise as to how should I deal with this problem.
Thank you...
===
Viral Shah
viral@noeticsolutions.com