in reply to JavaScript and form submission

I never found the values of submit buttons to be of much use as CGI parameters, because IE and FireFox have different ideas on what to send there - one sends the caption of the button and the other sends the value.

Why don't you just add a hidden parameter that tells you that the page was not requested in its initial state but submitted as a form?

Replies are listed 'Best First'.
Re^2: JavaScript and form submission
by rashley (Scribe) on Nov 21, 2006 at 14:51 UTC
    Then how do I tell the difference between the Submit and Cancel buttons?

      If you can use Javascript, just set the value of the hidden field accordingly. If you're supporting non-Javascript too, make the "cancel" link a GET request instead of a button.

        if you can use JavaScript

        It is more important if your users can use JS. Since you usually don't know, systems should be designed so they are still functional if JS isn't available.

Re^2: JavaScript and form submission
by dorward (Curate) on Nov 22, 2006 at 13:18 UTC

    I never found the values of submit buttons to be of much use as CGI parameters, because IE and FireFox have different ideas on what to send there - one sends the caption of the button and the other sends the value.

    This is a bug in IE, since the spec is fairly clear on the matter, but not relevent to this issue since the submit() method in CGI.pm generates an input of type "submit", and not a button with different display text and value.