D
David
Hi,
I am having a slight problem validating radio buttons using customvalidator.
My buttons generated HTML look like...
<input id="MemberPage_MinorWorks_SpareLoadYesRadioButton" type="radio"
name="MemberPage:MinorWorks:SpareLoadCapacity"
value="SpareLoadYesRadioButton" />
<input id="MemberPage_MinorWorks_SpareLoadNoRadioButton" type="radio"
name="MemberPage:MinorWorks:SpareLoadCapacity"
value="SpareLoadNoRadioButton" />
In my JS, I have...
function CircuitTestedCheck(oSrc, args){
if(document.all['<%=SpareLoadYesRadioButton.ClientID%>'].checked == false
&& document.all['<%=SpareLoadNoRadioButton.ClientID%>'].checked == false){
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
which is referenced by the custom validator.
The ClientID when generated follows the ID not the name of the control, but
I think the JS will require the name, which looks very different.
I was doing exactly this for checkboxes. What should I do for the radio
buttons?
Thanks.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
I am having a slight problem validating radio buttons using customvalidator.
My buttons generated HTML look like...
<input id="MemberPage_MinorWorks_SpareLoadYesRadioButton" type="radio"
name="MemberPage:MinorWorks:SpareLoadCapacity"
value="SpareLoadYesRadioButton" />
<input id="MemberPage_MinorWorks_SpareLoadNoRadioButton" type="radio"
name="MemberPage:MinorWorks:SpareLoadCapacity"
value="SpareLoadNoRadioButton" />
In my JS, I have...
function CircuitTestedCheck(oSrc, args){
if(document.all['<%=SpareLoadYesRadioButton.ClientID%>'].checked == false
&& document.all['<%=SpareLoadNoRadioButton.ClientID%>'].checked == false){
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
which is referenced by the custom validator.
The ClientID when generated follows the ID not the name of the control, but
I think the JS will require the name, which looks very different.
I was doing exactly this for checkboxes. What should I do for the radio
buttons?
Thanks.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available