How can i disable a Struts radio based on other element form
843838Aug 16 2006 — edited Aug 18 2006I need some help to do this.
I saw some examples in the web to disable a radio button with javascript, and all is right with normal HTML tags.
But when i was try to do the same over Struts code it's not functioning.
I show below my code:
function habilitaoficina(){
DetTrainFrm.opcsem.disabled=false;
DetTrainFrm.numemp.disabled=true;
DetTrainFrm.oficina.disabled=false;
DetTrainFrm.oficina.focus();
}
function habilitaempleado(){
DetTrainFrm.opcsem.disabled=true;
DetTrainFrm.oficina.disabled=true;
DetTrainFrm.numemp.disabled=false;
DetTrainFrm.numemp.focus();
}
<BODY>
<html:form action="/GetDetailTrain" name="DetTrainFrm" type="com.anmex.AppPhoneQst.forms.GetDetailTrainFormBean">
<TABLE border=1 align="center">
<TR>
<TD><html:radio property="opcion" value="1" onclick="habilitaoficina()"></html:radio>Oficina:</TD>
<TD><html:radio property="opcion" value="2" onclick="habilitaempleado()"></html:radio>Empleado:</TD>
</TR>
<TR><TD>Semanas<br>
<html:radio property="opcsem" value="1">Solo semana elegida</html:radio><br>
<html:radio property="opcsem" value="2">Desde semana hasta fecha actual</html:radio><br><br>
</TD>
</TR>
<TR><TD align="center" colspan=2><html:button property="Consulta" onclick="valida()">Consultar</html:button></TD>
</TR>
</TABLE>
</html:form>
</BODY>
When i'm trying to execute the JSP, the radios weren't disabled.
If somebody can give me a handto solve this issue it'll be apreciated
For any response send me by mail to rey_junior@yahoo.com
Message was edited by:
JosueRmz