"Matt" <> wrote in message
news: om...
> I tried to figure out how many approaches to submit form data.
Or, none of the below.
Typically this is done with three submit buttons, each with the same name
but a different value.
Have your server script parse which button was used by looking at the
value, and then send the data on it's way.
If you must use javascript, then do something like this
<form onsubmit="changeAction()">....
function changeAction(){
var form=document.forms[0];
if(form['submit_name'].value == 'action1'){
form.action='some_server_script...
You may have to adjust that as I'm not sure if javascript will read the
pushed submit value without some help.
Jeff
>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()
> { file://etc...
> formName.submit();
> }
> <input type="button" onClick="submitForm()">
>
> 3) onsubmit event handling
> <form name="formName" action="url" method="post" onsubmit="return
> submitForm()">
> function submitForm()
> { file://etc...
> file://formName.submit(); file://NOT NECESSARY!!
> }
> <input type="submit">
|