Interestingly, I have never even thought of using a <button> within a form :) I suppose it is subconscious, but I always use <input type="text"> within forms and <button> outside them.
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). 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. Again, I see your logic... have a different submitted value than what the button actually submits. Some components are known (and supposed) to get the value from their content (<textarea> as an example), and it doesn't seem actually "wrong" to do this for a button too (although the spec doesn't seem to say what *should* happen either way... leave it to Microsoft to exploit ambiguity!) It's an interesting demonstration though... putting everything I said aside, you'd want them to act the same regardless of what is right or wrong :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, June 28, 2005 2:46 pm, Jeff Beal said: > Oddly, the <button/> element doesn't work well in Internet Explorer. > (I just checked.) > > I have this form in an HTML page: > <form action="test.html" method="get"> > <button name="btn" value="1" type="submit">Click</button> > <button name="btn" value="2" type="submit">Click 2</button> > </form> > > Now, if you click on one of the buttons, only that button and its > value are supposed to be submitted. However, both are. Not only > that, but the button text is submitted, not the value: > file:///C:/work/scratch/test.html?btn=Click&btn=Click+2 > > Clicking the first button in Firefox gives me the URL: > file:///C:/work/scratch/test.html?btn=1 > > So, as long as you want to support Internet Explorer, there's not much > use to the <button> element as opposed to <input type="submit"/>. > > -- Jeff > > On 6/28/05, Wendy Smoak <[EMAIL PROTECTED]> wrote: >> From: "Gary Cauthon" <[EMAIL PROTECTED]> >> >> > Using HTML, I can create a button using this syntax: >> > <button name="removeButton" value="1">remove</button> >> > <button name="removeButton" value="2">remove</button> >> > >> > So how do I >> > do this with the struts html:button tag? As far as I can tell, it >> just >> > renders an tag of type "input" that does nothing when you click it. >> > Do I need to write it myself via a taglib? >> >> Struts <html:button> does render an <input> tag, not a <button> tag. >> http://struts.apache.org/userGuide/struts-html.html#button >> >> I can't say why we don't have something that renders <button>. It's in >> the >> HTML 4.01 specification so I don't think there would be any objection to >> adding it if someone wanted to. (Though what would we call it?) >> >> Back to your issue... if the content isn't dynamic, you can just use >> <button> directly. If it is dynamic, you can embed a <c:out> tag for >> the >> values... or just an expression if you're on a JSP 2.0 container. >> >> -- >> Wendy Smoak >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]