You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mississippi John Hurt <jo...@gmail.com> on 2006/09/01 19:40:09 UTC

tag and User bypassing onclick() by pressing

I have an <html:image> tag with onClick set. So when users press button, it
does something. The problem is what if user type input into a field say
keywordSearch, then they press <ENTER>.  In that case the logic in the
onClick attribute is not executed.  I tried to put that into an onSubmit
tag, but there's no such attibute. So how can I get it so that if a user
press <ENTER> instead of clicking the button, that I can execute some custom
logic (to set form param) before it goes to my Action class?  Thanks.

Re: tag and User bypassing onclick() by pressing

Posted by Mississippi John Hurt <jo...@gmail.com>.
The <html:form> has an onsubmit but how would it know which button was
pressed?

On 9/1/06, Mississippi John Hurt <jo...@gmail.com> wrote:
>
> I have an <html:image> tag with onClick set. So when users press button,
> it does something. The problem is what if user type input into a field say
> keywordSearch, then they press <ENTER>.  In that case the logic in the
> onClick attribute is not executed.  I tried to put that into an onSubmit
> tag, but there's no such attibute. So how can I get it so that if a user
> press <ENTER> instead of clicking the button, that I can execute some custom
> logic (to set form param) before it goes to my Action class?  Thanks.
>