http://www.perlmonks.org?node_id=411940


in reply to Re^3: Review: CGI::Prototype
in thread Review: CGI::Prototype

the runmode is determined by a CGI parameter, usually named 'rm'. Because of that, it usually is a hidden input called 'rm' with the name of the next runmode as its value.

The Submit buttons sound like an interesting idea ... There are a few interesting quirks to it, but it looks like it could be made to work. ++!

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^5: Review: CGI::Prototype
by hardburn (Abbot) on Dec 02, 2004 at 20:45 UTC

    You get into namespace issues. It's easy to give two submit buttons the same value in your application that are supposed to go to different runmodes. In a large application, you'll probably run out of good names eventually.

    I always felt that HTML using the "value" param on submit buttons was a bad design choice, and I think this illustrates that problem well. This, of course, is HTML's problem, not C::A's.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      I always felt that HTML using the "value" param on submit buttons was a bad design choice, and I think this illustrates that problem well. This, of course, is HTML's problem, not C::A's.

      Actually, it is Microsoft's problem. HTML has the buttom element which allows you to seperate the form value from the buttom display. IE6 messes it up, though. Otherwise, you could do something like:

      <button type="submit" name="runmode" value="doform1">Send Form</button>

        Wow, never even knew that worked.

        For those tuning in at home, I did some testing. I implemented a basic form with this:

        <button type="submit" name="runmode" value="1">Send</button>

        Firefox correctly sends this as "runmode=1", while IE sends "runmode=Send". Thanks to MS for ruining a fix to one of HTML's design flaws!

        "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.