All,
I just started to playing with the CustomValidator object and got it working where my javascript will be called. I'm trying to validate multiple controls with one CustomerValidator and one piece of javascript. I've read from the MSDN that:
The other half of the problem is how can I dynamically set the ErrorMessage property of the CustomerValidator in my javascript. I can't find any examples of that. Can anyone help?
Here's what I got so far:
Oh yeah all of this crap is in an Infragistics Warp Pane inside Web Tab to make it even more complicated for me. That explains the igtab_getElementById. ;-)
Thanks
-- Joe --
Journeyman -- The Order of the Seekers of Truth and Penitence
I just started to playing with the CustomValidator object and got it working where my javascript will be called. I'm trying to validate multiple controls with one CustomerValidator and one piece of javascript. I've read from the MSDN that:
But I can't get the javascript to run without at least setting one control in the ControlToValidate property so that is one minor issue.It is possible to use a CustomValidator control without setting the ControlToValidate property. This is commonly done when you are validating multiple input controls ...
The other half of the problem is how can I dynamically set the ErrorMessage property of the CustomerValidator in my javascript. I can't find any examples of that. Can anyone help?
Here's what I got so far:
Code:
... Inside my javascript tag ...
function PromiseValidate(source, args) {
//Get Drop Down List SelectedValue
var ddl = igtab_getElementById('ddlRecordStatus UltraWebTab1');
if (ddl.selectedIndex == 4) {
var checkNo = igtab_getElementById('wteCheckNo UltraWebTab1');
var checkAmt = igtab_getElementById('wteCheckAmount UltraWebTab1');
var checkDate = igtab_getElementById('wdcCheckDate UltraWebTab1');
if (checkNo.text == '') {
alert('set false');
args.IsValid = false;
return;
}
if (checkNo.text == '') {
alert('set false');
args.IsValid = false;
return;
}
}
args.IsValid = true;
}
...Inside my html table...
<td>
<asp:CustomValidator ID="cvOne" runat="server" ClientValidationFunction="PromiseValidate" ControlToValidate="txtRecordComments" ValidateEmptyText="True"></asp:CustomValidator>
<asp:ValidationSummary ID="vsMaster" runat="server" ShowMessageBox="true" ShowSummary="true" DisplayMode="BulletList" />
</td>
Oh yeah all of this crap is in an Infragistics Warp Pane inside Web Tab to make it even more complicated for me. That explains the igtab_getElementById. ;-)
Thanks
-- Joe --
Journeyman -- The Order of the Seekers of Truth and Penitence