Click to See Complete Forum and Search --> : Getting to the next page with a hidden field


gsnyder
08-11-2003, 09:00 PM
I'm having a problem getting to the next page from the current page when I use javascript document.FormName.submit(); in a function for the HTML onclick event. Instead of going to the next page that is specified, it just comes back to the current page. Here is my code below:

<SCRIPT LANGUAGE=javascript>

function DoSubmit()
{
document.salary.action="mds_new.asp";
document.salary.submit();
}
</SCRIPT>
.
.
.
<FORM name=salary action=mds_new.asp method=post>
<INPUT type=hidden name=ckbxDEM value=on>
</FORM>
.
.
.
<TR>
<TD colspan="4" align="center">
<INPUT id="continue" name="continue" type="submit" size=24 value="Continue" onclick="DoSubmit()">
</TD>
</TR>

Am I missing some code that would cause it to go to the mds_new.asp page? Thanks for any advice you can give on this.

gsnyder
08-11-2003, 10:23 PM
Originally posted by Dave Clark
Try changing this:

<INPUT id="continue" name="continue" type="submit" size=24 value="Continue" onclick="DoSubmit()">

to this:

<button id="continue" onclick="DoSubmit()">Continue</button>

Thanks, Dave! That worked perfectly!!!