Form Submit Script

admin

Administrator
Staff member
I have a form with multiple buttons to submit it. Of course the designer wants these buttons to be images (which don't pass a value like a submit button). So I made this script to submit the form and pass a value to a hidden input (just like the submit button). This functions properly but it sounds like a triple-click when you click one of the buttons. Something's
happening multiple times, I don't know what. Any ideas?

<SCRIPT language="JavaScript1.2">
function submitScript(nextPage) {
if (nextPage == 1) //back
{
document.form2.button_val.value = 1;
}
document.form2.submit();
if (nextPage == 2) //next
{
document.form2.button_val.value = 2;
}
document.form2.submit();
if (nextPage == 3) //done
{
document.form2.button_val.value = 3;
}
document.form2.submit();
if (nextPage == 4) //Florida Private
{
document.form2.button_val.value = 4;
}
document.form2.submit();
if (nextPage == 5) //Florida Public
{
document.form2.button_val.value = 5;
}
document.form2.submit();
if (nextPage == 6) //Fortune 500
{
document.form2.button_val.value = 6;
}
document.form2.submit();
if (nextPage == 7) //International
{
document.form2.button_val.value = 7;
}
document.form2.submit();
if (nextPage == 8) //Government
{
document.form2.button_val.value = 8;
}
document.form2.submit();
}
</SCRIPT>
 
Back
Top