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]

Reply via email to