I'm using an image as my submit button. I want it to check to ensure all boxes have a value before submitting (I will make the verification more stringent later), and if there is none, to cancel the form submission. I created a readonly input box that changes from white to a visible color to use as a status indicator for now. It displays the correct status in either scenario, but return false doesn't seem to be stopping the page from loading. What function would do that? Thanks. :)
<form method="post" action="send.php">
...
...
<input type=image src="submitbutton.jpg"
alt="Click Here To Submit" onClick="javascript:sendform();"></form>
Earlier in the page I created the function below...
function sendform(){
//verification script.
if ((document.forms[0].variable1.value=="") || (document.forms[0].variable2.value=="") || (document.forms[0].variable3.value==""))
{
//Update the sending status.
document.forms[0].statusindicator.value='Please fill in all forms.';
alert("Please fill in all forms. Thanks.");
return false;
} else {
//Update the sending status.
document.forms[0].statusindicator.value='Sending...Please Wait.';
}
}