M
Matt
I tried to figure out how many approaches to submit form data. Here's my
attempts.
Please advise. Thanks!!
1) html submit button, most commonly used.
<form name="formName" action="url" method="post">
<input type="submit">
2) html regular button, and a JavaScript to invoke the form.submit() method
<form action="url"
function submitForm()
{ //etc...
formName.submit();
}
<input type="button" onClick="submitForm()">
3) onsubmit event handling
<form name="formName" action="url" method="post" onsubmit="return
submitForm()">
function submitForm()
{ //etc...
//formName.submit(); //NOT NECESSARY!!
}
<input type="submit">
attempts.
Please advise. Thanks!!
1) html submit button, most commonly used.
<form name="formName" action="url" method="post">
<input type="submit">
2) html regular button, and a JavaScript to invoke the form.submit() method
<form action="url"
function submitForm()
{ //etc...
formName.submit();
}
<input type="button" onClick="submitForm()">
3) onsubmit event handling
<form name="formName" action="url" method="post" onsubmit="return
submitForm()">
function submitForm()
{ //etc...
//formName.submit(); //NOT NECESSARY!!
}
<input type="submit">