473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CustomValidator for Radio Button

I have a CustomValidator for a Radio Button that works fine with IE, but
doesn't trigger with Firefox or Netscape.

I have been stuck on this one for 3 weeks; any suggestions greatly
appreciated.

Thanks!

<script language="javascript">
function ValidateRadiobutton(oSrc, args) {
if(document.getElementById("<%=rbChoiceA.ClientID% >").checked == false
&&
document.getElementById("<%=rbChoiceB.ClientID%>") .checked ==
false){
args.IsValid = false;
}
}
</script>

<asp:CustomValidator id="vld1PaymentType"
ClientValidationFunction="ValidateRadiobutton" runat="server"
ErrorMessage="Payment Type must be selected"
CssClass="ValidationMessage"></asp:CustomValidator>
Nov 19 '05 #1
1 3280
Hi Ricky,

The ASP.NET 1.x validators do not support client-side validation on anything
but DHTML browsers (IE and IE/Mac). *always* create validation on the server
side to handle cases where the browser doesn't get supported or has
javascript turned off.

ASP.NET 2.0 and my Professional Validation And More
(http://www.peterblum.com/vam/home.aspx) both support client-side validation
on more browsers than the original ASP.NET 1.x validators.
In my Professional Validation And More, there are 25 validators including
those that can detect the rules you've described below (use my
CheckStateValidator and MultiConditionValidator).

--- Peter Blum
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Ricky Williams" <rw*********@yahoo.com> wrote in message
news:q%*****************@tornado.rdc-kc.rr.com...
I have a CustomValidator for a Radio Button that works fine with IE, but
doesn't trigger with Firefox or Netscape.

I have been stuck on this one for 3 weeks; any suggestions greatly
appreciated.

Thanks!

<script language="javascript">
function ValidateRadiobutton(oSrc, args) {
if(document.getElementById("<%=rbChoiceA.ClientID% >").checked == false
&&
document.getElementById("<%=rbChoiceB.ClientID%>") .checked ==
false){
args.IsValid = false;
}
}
</script>

<asp:CustomValidator id="vld1PaymentType"
ClientValidationFunction="ValidateRadiobutton" runat="server"
ErrorMessage="Payment Type must be selected"
CssClass="ValidationMessage"></asp:CustomValidator>

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: jcpmeticulus | last post by:
Hi I've spent the last day or so debugging a problem with a CustomValidator and am now totally stumped! Basically I use a number of CustomValidator's on my page, but have cut this down now to...
2
by: George Ter-Saakov | last post by:
Hi. I am fighting the CustomValidator strange behavior for second day already. I created some test project which is only to reproduce the problem. 1. I created UserControl which has an only a...
2
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a...
3
by: Ronan Dodworth | last post by:
Hi there I'm having a little bit of a problem with my customvalidator control. The problem is the javascript runs fine on my local webserver IIS but not when I post it to the web hosting server....
1
by: Vi | last post by:
Hi, I have a TextBox, Button and CustomValidator web controls on an aspx page. When a user clicks the Button, I want to perform server side validation of the textbox with the method specified in...
1
by: Beffmans | last post by:
Hi I have defined an customvalidator on my TextBox: function clientvalidate(source, arguments){ { // even number? if (arguments.Value%2 == 0) arguments.IsValid = true; else
1
by: David | last post by:
I need help with CustomValidator in 1.1. I added the CustomValidator control and code as per the doc., (See below) However, the code is never executed. Is there an extra switch or setting to...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
2
by: Jeff | last post by:
hey net 3.5 I have problem with a customvalidator. I enter values into the TextBox named "txt" and clicks on the save button (ibSave) then the TestValidate method get triggered. TestValidate...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.