Form Submit button trigger programmatically?
Posted: Tue Nov 08, 2011 6:46 pm
I'm trying to make my fields on the NB webpage live rather than having to hit a submit button each time. I found I can use the 'onChange' tag as shown below that will call a javascript function whenever the value for the field changes, which is perfect.
I now want to use that javascript function to programmatically hit the submit button. Below is the modified HtmlFormPost example with what I'm trying to do. I know html a bit better than javascript, so I'd prefer leaving all my actual forms in html rather than convert the entire thing to javascript. I just want to use javascript to post the form.
Thanks.
Scott
I now want to use that javascript function to programmatically hit the submit button. Below is the modified HtmlFormPost example with what I'm trying to do. I know html a bit better than javascript, so I'd prefer leaving all my actual forms in html rather than convert the entire thing to javascript. I just want to use javascript to post the form.
Thanks.
Scott
Code: Select all
<SCRIPT TYPE="text/javascript">
<!--
function submitchange(value)
{
/* What goes here to submit the form using post? */
<!-- // alert("Test change"); -->
}
//-->
</SCRIPT>
<table>
<form action="form1" method=post>
<tr>
<td width=40> </td>
<td>Enter data to post: <input type="text" name="textForm1" onChange="submitchange()" value="<!--FUNCTIONCALL WebTextForm1 -->"></td>
<td><input type="submit" value="Submit"></td>
</tr>
</form>
</table>