473,386 Members | 1,817 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,386 software developers and data experts.

datagrid and radio buttons question

Jay
I need to validate 21 sets of radio buttons before submission to the server
for calculation and storage. Is it best to validate on the client side
using javascript or to validate on the server using the code behind
vbscript. It seems that natural to validate before submission.

If javascript is the best then how do I the variables. I noticed some
javascript that was dynamically created which looks like the following:

dgQuestions$_ctl7$_ctl0

Is this something similar to what I need to do?

Or are there alternate methods to access the variables. Below is the
datagrid control that I have defined. There are 4 radio buttons per
question in the datagrid. The radio buttons are databound as are the
questions.

Thank you so much!

<asp:datagrid ItemStyle-HorizontalAlign="Left"
ItemStyle-VerticalAlign="Middle"
BackImageUrl="images/keyboardwatermark.JPG" 1BackColor="lightsteelblue"
AlternatingItemStyle- BackColor="gainsboro"
id="dgSections"
runat="server" DataKeyField="QID" Width="90%">
<SelectedItemStyle-Font-Bold="True" ForeColor="White"
BackColor="LightCoral"></SelectedItemStyle>
<HeaderStyle Font-Size="8" Font-Bold="True" ForeColor="lightsteelblue"
BackColor="#333333"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCC99"></FooterStyle>
<Columns>
<asp:TemplateColumn HeaderStyle-Font-Size="7"
HeaderStyle-HorizontalAlign="CENTER" HeaderText="Disagree------>Agree">
<ItemTemplate>
<asp:radiobuttonlist Font-Size="7" DataSource='<%# LoadNames() %>'
DataValueField="AID" DataTextField="" runat="server" ID="ddlAnswers"
RepeatColumns="4">
</asp:radiobuttonlist>
/ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Right" ForeColor="Black"
BackColor="White"></PagerStyle>
</asp:datagrid>
Nov 18 '05 #1
1 1589
You would have to write a custom validator to do this. Microsoft doesn't
supply a validator that handles RadioButtonLists (nor CheckBoxLists). This
also means that you will have to write the javascript needed for client-side
validation.

I have a commercial solution. My product, "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) includes validators for
RadioButtonLists amongst its 22 validators.

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

"Jay" <ja**********@hotmail.com> wrote in message
news:Uk%Rb.3226$EW.3080@okepread02...
I need to validate 21 sets of radio buttons before submission to the server for calculation and storage. Is it best to validate on the client side
using javascript or to validate on the server using the code behind
vbscript. It seems that natural to validate before submission.

If javascript is the best then how do I the variables. I noticed some
javascript that was dynamically created which looks like the following:

dgQuestions$_ctl7$_ctl0

Is this something similar to what I need to do?

Or are there alternate methods to access the variables. Below is the
datagrid control that I have defined. There are 4 radio buttons per
question in the datagrid. The radio buttons are databound as are the
questions.

Thank you so much!

<asp:datagrid ItemStyle-HorizontalAlign="Left"
ItemStyle-VerticalAlign="Middle"
BackImageUrl="images/keyboardwatermark.JPG" 1BackColor="lightsteelblue" AlternatingItemStyle- BackColor="gainsboro"
id="dgSections"
runat="server" DataKeyField="QID" Width="90%">
<SelectedItemStyle-Font-Bold="True" ForeColor="White"
BackColor="LightCoral"></SelectedItemStyle>
<HeaderStyle Font-Size="8" Font-Bold="True" ForeColor="lightsteelblue"
BackColor="#333333"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCC99"></FooterStyle>
<Columns>
<asp:TemplateColumn HeaderStyle-Font-Size="7"
HeaderStyle-HorizontalAlign="CENTER" HeaderText="Disagree------>Agree">
<ItemTemplate>
<asp:radiobuttonlist Font-Size="7" DataSource='<%# LoadNames() %>'
DataValueField="AID" DataTextField="" runat="server" ID="ddlAnswers"
RepeatColumns="4">
</asp:radiobuttonlist>
/ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Right" ForeColor="Black"
BackColor="White"></PagerStyle>
</asp:datagrid>

Nov 18 '05 #2

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

Similar topics

4
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1>...
3
by: Jay | last post by:
I noticed somewhere on the net that a post mentioned that there was a bug in the datagrid, radio buttons and a repeater. Something about the radio buttons are not mutually exclusive. (will this be...
5
by: Eric Caron | last post by:
Hi everyone, I have a web form that asks the user what languages he speaks and what his skill level is. I used a DataGrid control bound to a table that contains the languages and three template...
3
by: Ken Varn | last post by:
This is probably a simple question, but I am new to this so bear with me. I have a ASP.NET form that has a checkbox and a 2 radio buttons. When the checkbox is checked, the 2 radio buttons are...
1
by: Jerry | last post by:
We have a 10-question quiz for kids, each question being a yes or no answer using radio selections. I'd like to keep a current total of yes's and no's at the bottom of the quiz (if the user selects...
2
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
2
by: JimS | last post by:
I am using DotNet 2.0 and Visual Studio 2005. The project is a web project. I am currently using an ObjectDataSource to populate a datagrid. The ObjectDataSource is configured to a function in a...
5
by: alanb | last post by:
Hi, hope someone can help, I need to be able to keep a running total of radio buttons selected, as a user goes through a set of 16 questions, devided in to 4 catorgories, then on "submit" have the...
4
by: CURTISLESPERANCE | last post by:
Hi, I am trying to figure out if this is possible. I need to display 4 radio buttons next to a question then 3 radio buttons after. The 2 different group radio buttons and questions are coming from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.