struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Beal <jbb...@gmail.com>
Subject Re: Render an html button tag
Date Wed, 29 Jun 2005 12:56:56 GMT
I sent a couple of additional comments on this to Frank; I guess I
should have paid more attention so they made it to the list, too.  I
won't belabor the points too much, but if you're interested in this
question, section 17.13.2 "Successful Controls"
(http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2) specifies
which controls are submitted to the server with a form.  It clearly
specifies that "only the activated button is successful".

There are two different ways to tag a "submit button".  The most
common way is <input type="submit">.  The less common way is <button
type="submit">.  According to the HTML DTD, <input> is an empty
element, but <button> allows almost any HTML element, except for links
or other form controls.

On 6/28/05, Michael Jouravlev <jmikus@gmail.com> wrote:
> On 6/28/05, Frank W. Zammetti <fzlists@omnytex.com> wrote:
> > I'm curious though... I'm looking at the 4.01 spec now and I don't see
> > anyplace that says the non-clicked button shouldn't be submitted... I
> > would actually expect it to work like any other form element in that they
> > all get submitted regardless (although I do see the logic in your
> > expectation).
> 
> I don't know about just buttons, but submit buttons are sent only in
> quantity of one: the one which was clicked. Also, wnen I tested my
> dispatch action, I saw that if no buttons clicked, then browser still
> sends one, that was defined first.
> 
> > The point about the value being submitted seems more of an issue to me
> > though... that being said, what is happening in IE is pretty clear...
> > wrapping text with a <button></button> is overriding the value attribute.
> > This makes sense in a way... I've never seen text wrapped with a button
> > like that, which doesn't make it wrong or anything of course, just new to
> > me.  I've only ever seen the value as an attribute.
> 
> Never saw it too, tried it, and it did not work on Firefox.

What exactly did you try that did not work on Firefox?

<button type="submit" name="foo" value="bar">Some Text</button> will
work in Firefox.
<input type="submit" name="foo" value="bar">Some Text</input> will not
work.  (As mentioned above, the DTD specifies <input> as an empty
element.)
> 
> > have a different submitted value than what the button actually
> > submits.

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


Mime
View raw message