Do you have other forms in the page? In the html output did you check the form name?
Do you get a javascript error ? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 9:41 AM To: Struts Users Mailing List Subject: RE: How to identify submit button in JSP That's what I did. But the 'modify' button didn't react at all. --- Yann Lebreton <[EMAIL PROTECTED]> wrote: > Try: > function Disable() { > frm=document.forms['form1'] > if(frm.ids.checked) > {frm.modify.disabled=false} > else {frm.modify.disabled=true} > } > > Or simpler: > function Disable() { > frm=document.form1; > frm.modify.disabled = !( frm.ids.checked ); > } > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 19, 2003 8:30 AM > To: [EMAIL PROTECTED] > Subject: How to identify submit button in JSP > > Hi, > > I am new to struts, now I have trouble figuring this > out. I do need to have this done, please help! > > My problem is the submit button didn't react to > changes on checkbox, is that because I didn't > identify > the button correctly or anything else I did wrong? > My > jsp code is like the following: (if I add > 'disabled="true"' in submit, the button will always > be > disabled). > > <SCRIPT LANGUAGE="JavaScript"> > function Disable() { > frm=document.forms[form1] > if(frm.ids.checked) > {frm.modify.disabled=false} > else {frm.modify.disabled=true} > } > </SCRIPT> > > <html:form > action="/Myaction" > name="form1" > type="MyformType"> > > <input type="submit" name="add" value="Add"/> > <input type="submit" name="modify" value="Modify"/> > <input type="submit" name="delete" value="Delete"/> > > <% > while (iterator.hasNext()) > { > String v1=...; > %> > <input type="checkbox" name="ids" value="v1" > onClick="Disable();"/>something > <% > } > %> > > What I eventually want to do is to disable this > 'modify' button when no checkbox or more than one > are > selected. In other word, only enable it when only > one > checkbox is selected, this is just the first step, > but > it's not working. > > Thanks in advance! > > __________________________________ > Do you Yahoo!? > Protect your identity with Yahoo! Mail AddressGuard > http://antispam.yahoo.com/whatsnewfree > > --------------------------------------------------------------------- > 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] > __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree --------------------------------------------------------------------- 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]