473,765 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validating a RadioButton Selection

I am having trouble validating that a selection has been made from a
RadioButton.

I created a script to trigger from a CustomValidator , however, it only works
when I run the app locally, from the debugger. Once I upload it to the
server and run, the script no longer triggers.

Any ideas?

Thanks in advance,
Scott

<script language="javas cript">
function ValidateRadiobu tton(oSrc, args) {
if(document.all["<%=rbChoiceA.C lientID%>"].checked == false &&
document.all["<%=rbChoiceB.C lientID%>"].checked == false &&
document.all["<%=rbChoiceC.C lientID%>"].checked == false){
args.IsValid = false;
}
}
</script>

<asp:CustomVali dator id="vld1Chkbox "
ClientValidatio nFunction="Vali dateRadiobutton " runat="server"
ErrorMessage="S election must be made"
CssClass="Valid ationMessage"></asp:CustomValid ator>

Nov 18 '05 #1
2 1430
I had this once too...

What you need to do is copy the directory in the IIS folder called
"aspnet_cli ent" into your application folder...
Check the file titled "WebUIValidatio n.js" exists here.
"Scott Natwick" <no**********@y ahoo.com> wrote in message
news:-9************** ******@comcast. com...
I am having trouble validating that a selection has been made from a
RadioButton.

I created a script to trigger from a CustomValidator , however, it only
works when I run the app locally, from the debugger. Once I upload it to
the server and run, the script no longer triggers.

Any ideas?

Thanks in advance,
Scott

<script language="javas cript">
function ValidateRadiobu tton(oSrc, args) {
if(document.all["<%=rbChoiceA.C lientID%>"].checked == false &&
document.all["<%=rbChoiceB.C lientID%>"].checked == false &&
document.all["<%=rbChoiceC.C lientID%>"].checked == false){
args.IsValid = false;
}
}
</script>

<asp:CustomVali dator id="vld1Chkbox "
ClientValidatio nFunction="Vali dateRadiobutton " runat="server"
ErrorMessage="S election must be made"
CssClass="Valid ationMessage"></asp:CustomValid ator>

Nov 18 '05 #2
Dan,

Thanks for your reply! That did it.

Scott

"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
I had this once too...

What you need to do is copy the directory in the IIS folder called
"aspnet_cli ent" into your application folder...
Check the file titled "WebUIValidatio n.js" exists here.
"Scott Natwick" <no**********@y ahoo.com> wrote in message
news:-9************** ******@comcast. com...
I am having trouble validating that a selection has been made from a
RadioButton .

I created a script to trigger from a CustomValidator , however, it only
works when I run the app locally, from the debugger. Once I upload it to
the server and run, the script no longer triggers.

Any ideas?

Thanks in advance,
Scott

<script language="javas cript">
function ValidateRadiobu tton(oSrc, args) {
if(document.all["<%=rbChoiceA.C lientID%>"].checked == false &&
document.all["<%=rbChoiceB.C lientID%>"].checked == false &&
document.all["<%=rbChoiceC.C lientID%>"].checked == false){
args.IsValid = false;
}
}
</script>

<asp:CustomVali dator id="vld1Chkbox "
ClientValidatio nFunction="Vali dateRadiobutton " runat="server"
ErrorMessage="S election must be made"
CssClass="Valid ationMessage"></asp:CustomValid ator>


Nov 18 '05 #3

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

Similar topics

11
7872
by: William Gill | last post by:
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep references to them in a 2 dimensional list ( rBtns ). It works fine, and I can even make it so only one button per column can be selected, by assigning each column to an intVar. In many languages a radiobutton has a property that can be directly read to see if it is selected on unselected. Tkinter radiobuttons don't seem to have any such property. Is there any way to...
1
3843
by: R.G. Vervoort | last post by:
I would like to make a script wich makes a select visible or not visible depending on what radio button is selected. If the radiobutton with the value "nieuw" is selected the pulldown is not visible and when i select the radiobutton with the value "verwijderen" the pulldown should become visible. The code i have makes the pull down visible but does not make it invisible after i select another radiobutton.
0
3192
by: Morné | last post by:
Hi how do I validate a text value in a datagrid e.g. the user is only allowed to type in a Y or a N. I specifically have a problem with using the PropertyDescriptorCollection. I get the following error: "Additional information: Cannot create a child list for field Query." Below my existing code:
1
1575
by: Sean | last post by:
hi, I have a radiobutton list say, Florida | New York | New Jersey | Texas the radiobutton list has autopostback set to true, as i fire up some code after one of the radiobuttons are selected. Now, i want to be able to traverse the radiobutton using only the keyboard, as i am firing a sql based on the selection, i can't seem to be able to pick Texas as a option, because once Florida is highlighted the sql is fired.
9
5845
by: chuck | last post by:
I need some help with validating user input. I am writing a C computer program for an intro to C course. Here is the situation. I am creating an application that will do currency conversions. The user will be presented with a list of 5 selections they can make. They will then be prompted for which selection they want to enter (which can only be 1-5, no characters or anything like it). Once they select the number, 1 for Euro, 2 for...
5
11656
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually click to select one of the radiobuttons to select. The default behavior of Focus() seems to also select the radiobutton, but I can't seem to find what is causing this to happen. I would like very much to seperate the Focus and the selection....
0
1786
by: BizEd | last post by:
I have a textbox that fires an autopostback when filled in. The next field after the textbox is a RadioButtonList which I set focus to. The radiobutton list does have focus and activates when you hit the spacebar, but the little selection box does not appear around the first item like it does when you tab to a radiobutton list. So in essence, the user has no idea where they are on the screen. I've tried both the focus() method and...
3
1657
by: Vinnie | last post by:
I placed the following code into my page, but i get an error message, why? The code is: if (this.RadioButtonContatto.Checked == "YES") The error message is: CS0117: 'System.Web.UI.WebControls.RadioButtonList' does not contain a definition for 'Checked'
0
1542
by: Emma Middlebrook | last post by:
Hi there, I'm having problems in an ASP.NET page that is dynamically creating and displaying radio buttons. I have setup a checkchanged event and specified AutoPostBack to true. When the page loads none of the radio buttons are checked by default. When the user checks the first one, the page refreshes but the checkchanged event never triggers. If you then select a different radio button, the postback occurs but the event also triggers.
0
10164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.