in reply to Re: <input type="button"> does not generate parameter=>value pair
in thread <input type="button"> does not generate parameter=>value pair

Well, I tried both onclick="this.form.submit();return true;" and onclick="return this.form.submit();" - nothing works... The only thing came to my mind - to create another hidden varuable and to assign a value to in in "onclick" handler.

--dda

Replies are listed 'Best First'.
Re: Re: Re: <input type="button"> does not generate parameter=>value pair
by Skeeve (Parson) on Jul 15, 2003 at 09:50 UTC
    You didn't get what I mean!
    You use a submit button. If you supply an onclick handler, this one has to return true in order for the button to submit anything.
    But your onclick handler already does the submit.

    Question: What do you want to achieve?

      I want to submit the form either by button1 or button2, and to get a value of clicked button. The reason I do not use two submit buttons - in real life my form has a text field as well, and when I press "Enter" in that text field, I want to submit a form with button2, not with button1. That is why I changed type=submit to type=button..

      Thank you for you help!

      --dda

        Looking at the Forms section of the HTML 4.1 W3c Recomendation i noticed that you can do:
        <BUTTON name="submit" value="submit" type="submit">
        to create a submit button using a Button instead of an Input. I'm not sure how this effects the default button pushed though.
        Eric Hodges