You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Shenton <Ch...@hq.nasa.gov> on 2001/12/11 00:44:12 UTC
Action-Events: hitting RETURN invokes form with invalid button
I'm following the Action-Event model from the HowTo and it works
rather nicely -- very clean. However, I've found one instance where
it seems to be a bit fragile.
If I create a simple form with only one text input field and a SUBMIT
button, Netscape automatically acts like I hit SUBMIT if I type my
text and just hit RETURN in the INPUT box. The Action-Event
processing does *not* appear to get a valid button name from the form
submission so falls through to the catch-all doPerform (per the HowTo).
Here's my form:
<FORM ACTION="$link.setPage("IntranetBroker.vm").setAction("IntranetBroker")"
METHOD="POST">
<b>Go to URL:</b>
<br>
<INPUT NAME="url" TYPE="TEXT">
<br>
<INPUT NAME="eventSubmit_doGeturl" VALUE="Get URL" TYPE="SUBMIT" >
</FORM>
My method IntranetBroker.doGeturl() is invoked properly if the user
types in and then clicks the "Get URL" SUBMIT button, but the code
falls through to the doPerform() catch-all if they type text and hit
RETURN, sending the form in without hitting the SUBMIT.
Is there a way to fix this? (I expect a form could have multiple
buttons, possibly multiple type=SUBMIT ones; could Action-Events be
made to use one as a default for the method selection?)
Is there a way to see what non-button is getting to my class?
Thanks.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Action-Events: hitting RETURN invokes form with invalid button
Posted by John McNally <jm...@collab.net>.
If netscape only does this for one submit button, you can use a hidden
input to give the event name. If netscape does this when multiple
buttons are present, I would say it is a bug, but you can just write
your doPerform method to account for it.
john mcnally
Chris Shenton wrote:
>
> I'm following the Action-Event model from the HowTo and it works
> rather nicely -- very clean. However, I've found one instance where
> it seems to be a bit fragile.
>
> If I create a simple form with only one text input field and a SUBMIT
> button, Netscape automatically acts like I hit SUBMIT if I type my
> text and just hit RETURN in the INPUT box. The Action-Event
> processing does *not* appear to get a valid button name from the form
> submission so falls through to the catch-all doPerform (per the HowTo).
>
> Here's my form:
>
> <FORM ACTION="$link.setPage("IntranetBroker.vm").setAction("IntranetBroker")"
> METHOD="POST">
> <b>Go to URL:</b>
> <br>
> <INPUT NAME="url" TYPE="TEXT">
> <br>
> <INPUT NAME="eventSubmit_doGeturl" VALUE="Get URL" TYPE="SUBMIT" >
> </FORM>
>
> My method IntranetBroker.doGeturl() is invoked properly if the user
> types in and then clicks the "Get URL" SUBMIT button, but the code
> falls through to the doPerform() catch-all if they type text and hit
> RETURN, sending the form in without hitting the SUBMIT.
>
> Is there a way to fix this? (I expect a form could have multiple
> buttons, possibly multiple type=SUBMIT ones; could Action-Events be
> made to use one as a default for the method selection?)
>
> Is there a way to see what non-button is getting to my class?
>
> Thanks.
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>