[Javascript] action="insert"
Cutter
java.script at seacrets.com
Fri Feb 10 05:35:13 CST 2006
Or, maybe he only wants one submit type of button on his form...
Cutter
David Dorward wrote:
> On Fri, Feb 10, 2006 at 11:08:47AM +0100, Michael Borchers wrote:
>
>> i know some people like navigation their sites by using an "action" f.e.
>> parsed via form
>> <input type="hidden" name="action" value="...">...
>>
>> i once used 2 submit buttons that on click changed the value of the
>> "action" hidden field, f.e. "insert" or "delete".
>>
>
> You don't need JavaScript for this.
>
> <input type="submit" name="action" value="Insert">
> <input type="submit" name="action" value="Delete">
>
> Only the successful (i.e. clicked upon) control is submitted.
>
>
>> it didn't work until i decided to rename the button f.e. into "subaction".
>>
>> I guess that "action" is already covered by the <form action="..."> tag,
>> right?!
>>
>
> You haven't shown us your JavaScript code, but
> document.form['formId'].elements['action'] should work fine. Although,
> as I said, you don't need to do this.
>
>
More information about the Javascript
mailing list