G
gane kol
Hi
I have a set of Yes/No radio buttons with textboxes for each. I need to
write a common customvalidation function that checks, if radiobutton "yes"
is selected, the value in the corresponding textbox should be greater than
0.
For eg:
IsVM Qty: <radX0Yes> YES <radX0No> NO Qty: <txt00>
IsVM1 Qty: <radX1Yes> YES <radX1Yes> NO Qty: <txt11>
IsVM2 Qty: <radX2Yes> YES <radX2Yes> NO Qty: <txt22>
IsVM3 Qty: <radX3Yes> YES <radX3Yes> NO Qty: <txt33>
I created a customvalidator with clientsidevalidation for each set.
<asp:CustomValidator id="cvVM" runat="server" ErrorMessage="Required"
ControlToValidate="txtVMQty"
ClientValidationFunction="ValidateQty('radX0Yes','txt00')"></asp:CustomValid
ator>
function ValidateQty(objRadId,objTxtBoxId){
if (document.getElementById(objRadId).checked){
if (document.getElementById(objTxtBoxId).value <= 0){
arguments.IsValid = false; ??????
}}}
How can i make the arguments.IsValid to false or true based on the
condition?
Thanks
Gane
I have a set of Yes/No radio buttons with textboxes for each. I need to
write a common customvalidation function that checks, if radiobutton "yes"
is selected, the value in the corresponding textbox should be greater than
0.
For eg:
IsVM Qty: <radX0Yes> YES <radX0No> NO Qty: <txt00>
IsVM1 Qty: <radX1Yes> YES <radX1Yes> NO Qty: <txt11>
IsVM2 Qty: <radX2Yes> YES <radX2Yes> NO Qty: <txt22>
IsVM3 Qty: <radX3Yes> YES <radX3Yes> NO Qty: <txt33>
I created a customvalidator with clientsidevalidation for each set.
<asp:CustomValidator id="cvVM" runat="server" ErrorMessage="Required"
ControlToValidate="txtVMQty"
ClientValidationFunction="ValidateQty('radX0Yes','txt00')"></asp:CustomValid
ator>
function ValidateQty(objRadId,objTxtBoxId){
if (document.getElementById(objRadId).checked){
if (document.getElementById(objTxtBoxId).value <= 0){
arguments.IsValid = false; ??????
}}}
How can i make the arguments.IsValid to false or true based on the
condition?
Thanks
Gane