473,326 Members | 2,102 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,326 software developers and data experts.

radio button list doesn't hold value?

Hi. I have a radio button list with list items assigned via a
datareader from a database. Everything looks fine, the items are there
on page load, I can click one, etc. There is also a required validator
on the list.

However, when I hit SUBMIT, the selection disappears so the first line
of my submit click code (If Page.IsValid = True Then)...is always
"false" and nothing happens of course.

I'm probably just tired of staring at it, but how does this happen?

Thanks again. Kathy
Nov 17 '05 #1
2 1771
"KathyB" <Ka**********@attbi.com> wrote in message
news:75*************************@posting.google.co m...
Hi. I have a radio button list with list items assigned via a
datareader from a database. Everything looks fine, the items are there
on page load, I can click one, etc. There is also a required validator
on the list.

However, when I hit SUBMIT, the selection disappears so the first line
of my submit click code (If Page.IsValid = True Then)...is always
"false" and nothing happens of course.

I'm probably just tired of staring at it, but how does this happen?


Kathy,

As an experiment, try removing the RequiredFieldValidator, then, on
PostBack, check to see if you can change RadioButtonList.SelectedItem. I'd
also suggest turning on page tracing and look to see what gets posted back
for the RadioButtonList.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #2
Make sure you're using the check for IsPostBack in your Page_Load as
appropriate. You don't want to rebind your button list datasource
everytime, it should be in a check:

If Not IsPostBack Then
'create datasource/bind to list
End If

in Page_Load. As well as any other setup that is only to be run once....

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
"KathyB" <Ka**********@attbi.com> wrote in message
news:75*************************@posting.google.co m...
Hi. I have a radio button list with list items assigned via a
datareader from a database. Everything looks fine, the items are there
on page load, I can click one, etc. There is also a required validator
on the list.

However, when I hit SUBMIT, the selection disappears so the first line
of my submit click code (If Page.IsValid = True Then)...is always
"false" and nothing happens of course.

I'm probably just tired of staring at it, but how does this happen?

Thanks again. Kathy

Nov 17 '05 #3

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

Similar topics

1
by: Michael Albanese | last post by:
I am developing an application to handle my compay's OSHA reporting requirements. Some of the input criteria are technical and narowly defined, so I was trying to prvide what i call "Context...
1
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
6
by: sakms | last post by:
I am attempting to validate radio buttons in Netscape with JavaScript. Everything works excellent in Explorer, but refuses to work in Netscape (all versions). =========== JAVASCRIPT CODE...
3
by: Ferret Face | last post by:
Hello, I have a web page that gets the user to select items from a list of options. This list is a set of independant Radio Buttons. I did not use a Radio Button List because I wanted the...
1
by: Joe Attardi | last post by:
Hi all, On a form on one of my pages I have two <select> elements, and each one is paired up with a radio button. The idea is to choose an item from one list or the other and select the radio...
9
by: wreed | last post by:
I have a for loop seen below.... var the_form = document.getElementById(formName); for(var i=0; i<the_form.length; i++) { var temp = the_form.elements.type; if (temp == "radio") { for (x =...
1
by: Shane | last post by:
I think that I found a bug in the Radio Button, and I wanted to give everybody a "Heads Up". I spent three days doing trial and error until I found a work around. I created a user control with a...
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...
3
by: jahphill | last post by:
Hey. I thought id make a seperate discusion because the other became a bit lengthy and confusing. Aim: Create a php file which works with the script below, which makes the radiobuttons work =D...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.