You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nicolas De Loof <ni...@capgemini.com> on 2006/01/10 10:56:01 UTC

default submited image button

Hello,

I've a form with a text input field and two <html:image> buttons : one 
to "add new user" and one for "search"

My porblem is when I type [Return] from input field, the form is 
submited with some strange image button informations :
- on IE, non image button (x,y position) is submited, so I can use the 
default beheviour.
- on Firefox, I get x=0 and y=0 for the first "add new user" button.

This behaviour is not expected, as I'd like default submit to go to 
"search", and "add new user" to occur only when button is explicitly presed.

Do you know any way to change firefox behaviour ? I've tested using 
tabindex without result...

Nico.


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: default submited image button

Posted by Michael Jouravlev <jm...@gmail.com>.
On 1/10/06, Nicolas De Loof <ni...@capgemini.com> wrote:
>
> Hello,
>
> I've a form with a text input field and two <html:image> buttons : one
> to "add new user" and one for "search"
>
> My porblem is when I type [Return] from input field, the form is
> submited with some strange image button informations :
> - on IE, non image button (x,y position) is submited, so I can use the
> default beheviour.

??? You said above that both your buttons are image buttons.

> - on Firefox, I get x=0 and y=0 for the first "add new user" button.
>

For an image button, I get the following:

// MSIE: name.x=xcoord&name.y=ycoord
// Firefox: name.x=xcoord&name.y=ycoord&name=value

> This behaviour is not expected, as I'd like default submit to go to
> "search", and "add new user" to occur only when button is explicitly presed.

I have a hidded "defaultsubmit" field. Unless you explicitly do so in
Javascript, browser is supposed to submit no more than one submit
element. I check whether I receive button submit first. If yes I use
it, if not - I use value from "defaultsubmit" field.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org