-Matthew-
asked on
Multiple Submit buttons
Is it possible to have two submit buttons, one that runs javascript and one that submits without running the script or just by passes the validation.
I know I could just put an image there and send them on, but if I can just say submit and move on using the same form. I guess this is more of curiosity question.
Thanks
I know I could just put an image there and send them on, but if I can just say submit and move on using the same form. I guess this is more of curiosity question.
Thanks
<script type="text/javascript" language="javascript">
function validateForm()
{
var x=document.forms["myForm"]["guardian_household"].value
var y=document.forms["myForm"]["guardian_tanf"].value
if (x==null || x=="" || y==null || y=="")
{
alert("All fields required.");
return false;
}
}
</script>
<form name="myForm" action="" onsubmit="return validateForm()" method="post">
Name: <input type="text" name="guardian_household" id="guardian_household" /><br />
Tanf: <input type="text" name="guardian_tanf" id="guardian_tanf" />
<input name="answers" type="submit" class="submitbutton" id="answers" value="Submit Case Number and continue" />
<input name="answers" type="submit" class="submitbutton" id="answers" value="I Do Not Have A TANF / Food Stamp Case " />
</form>
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
@The_big_daddy OH too easy, why didn't I think of that. Its sometimes the easy answers that get over looked.
Thanks
Thanks
Open in new window