Unable to get the value for RadioButtonList

Greetings;

I am trying to get the the value of the checked RadioButtonList, but with no success.
To my javascript I am providing to strings variables, one is the ID of the control and the other is what type of control it is like..... "System.Web.UI.WebControls.ListBox" and "System.Web.UI.WebControls.RadioButtonList".
Following is my javascript:
<Script language="Javascript")
var popCalDstFld;
function OpenSelectHelpWindow(strFieldName, popCalDstFld_in)
{
if (popCalDstFld_in == 'System.Web.UI.WebControls.RadioButtonList')
{
popCalDstFld = document.getElementById(strFieldName);
var p;
for (var i = 0; i < popCalDstFld.length; i++) {
if (popCalDstFld[i].checked) {
p = i;
break
}
}
alert(popCalDstFld[p].value);
}
}
It generates the error: 'popCalDstFld[...].value' is null or not an object.
I checked this method for the following parametres:
strFieldName = 'Email'
popCalDstFld_in = 'System.Web.UI.WebControls.RadioButtonList'
Please help me.. I hope my question is complete.
0
giantcoder
10/10/2003 11:36:32 AM
asp.net.client-side 24353 articles. 2 followers. Follow

1 Replies
1343 Views

Similar Articles

[PageSpeed] 30
Get it on Google Play
Get it on Apple App Store


Put alert statements to debug your code

var popCalDstFld;
function OpenSelectHelpWindow(strFieldName, popCalDstFld_in)
{
if (popCalDstFld_in == 'System.Web.UI.WebControls.RadioButtonList')
{
alert("inside if statement");
popCalDstFld = document.getElementById(strFieldName);
alert("object is " + popCalDstFld);
var p;
for (var i = 0; i < popCalDstFld.length; i++) {
if (popCalDstFld[i].checked) {
p = i;
alert(p + " is checked");
break
}
}
alert(popCalDstFld[p].value);
}
}

see if that helps, post back if not.
-ron
0
macha27
10/11/2003 1:18:17 PM
Reply:

Similar Artilces:

Getting Value from Client-side InputBox to .net variable
hi, im doing a login page for our timekeeping. Since there's no msgbox available on asp.net, im doing it dynamically via javascript. How do i Get the value frm a dynamically written javascript (such as inputbox) to a .net variable? here's the logic of my program, user logs in hits the button and sub-routine Login will be fired, if user is late -- call Check_Late Sub, this is whre the client-side script was built -- then after that i wanted to be able to get the value from an inputbox. '// if button login clicked Sub Login(Sender As Object, E As EventArgs) .......

how to get value from client side script Prompt window to a session var in .net
hi guyz, i hav a problem with getting a value from a client-side inputbox to a session var in .net. is this possible? however, when i click submit button this is the code that's triggered. dim sb as New System.Text.StringBuilder sb.append("<script language=" & """" & "vbscript" & """" & ">") sb.append(vbcrlf) sb.append(vbcrlf) sb.append("do while xLate =" & """" & """") sb.append(vbcrlf) '//prompt window, val...

How to get the Client side values in server side code.
Hi all, i have a proble i need to get the client side javascript values in C# code at server side. how can i pass those values? i am using version 1.1, i kno thatwe can use callback events mechnisam in 2.0 or ajax ,apart from that how we can pass? My problem is i need to stop the execution of the code based on after reciving values from the client   any ideas please???   Million thanks RamCheersRam MCP Hello Ram, a common approach is from javascript set an hidden field, then issue a postback. On the server-side, handle the post-back. Feel free to go deeper in your que...

Getting hidden variable value from server side in client side
hi,        I am struck in problem. I have a hidden field in my form and i am setting some value in that.         Now i wnt to use this value from client side but i m not able to retrieve it. All i am getting there is an object.         I feel the hidden field is not able to hold that value.         <input type="hidden" id="hdnVar" runat="server" />         in code behind      ...

Client Side Get Value
I am trying to retrieve the current value of a textbox from my code behind and assign it to a variable. Currently I am using something like   dim id as new string  id = txtbox1.text.toString()  When I am loading the page I am checking for a cookie then putting the value of the cookie in the txtbox1. Currently when I use the code above it gets the value that was put in there by the cookie. Is there a way to retrieve the value if the user changes what the value is of that textbox? I know in Javascript there is  txtbox1.value But I am having trouble taking the value ...

How to get value from client side
in my program I want to send a value to my modal popup, how can I do that? Thanks lyha Is it what you are looking for?http://forums.asp.net/thread/1618616.aspx Anish DevasiaMCP,MCAD---------------------------------------------------...

pls help: how to get client-side HTML "text field" value from a server side button
i copy some javascript from somewhere so user can choose pick up a date from a calendar and display the date onto a HTML text field. I have no knowledge in writing client side script(i.e. write code in html) can i write some code in a server-side button to get the value in the HTML text field??? i tried: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click textbox1.text = document.getElementById("htmltext").value End Sub but "document" is highlighted, and say isn't declar yet. and...

How can I set client side values as server side values?
Hi, Can anyone tell me how I can get client side values such as document.referrer, navigator.appName etc... into server side scripts? There are some client side values I'd like to set as session vars and insert into the db? How do I go about this? Thanks for any pointers Davlon PS (I'm using powersite 7.1.0.300) Pass them as page parameters, e.g., http://myserver/myurl?document.referrer=whatever&navigator.appName=yadayada Then, in your server-side script, just loop through the document.value array and get these values. -- pbm_hopethishelps, Roy Kie...

how to get value from client-side Prompt
hi guyz, i'm doing a login page in .net, now after submission -- and if ur late -- a client-side prompt box will appear to enter your reason for being late , now.. how do i get the value back to .net??? could you please give me an example? thanx and GodBless. :) You could save the response from the client-side prompt into a hidden field and then extract the value on the server. This example, prompts for a reason, stores the response into a hidden field named "reason" and then extracts the reason from the Request.Form collection and sets it in the page: <%@ Page Lan...

Get textbox value in client side
My problem is that in my ascx file i have a textbox & a input buttom with a javascript function that will validate the textbox: .... <script lang="javascript"> function Test() { if (document.all.txt1.value == "") { alert(); return; } } </script> .... <asp:textbox id="txt1" runat="Server"></textbox> <input type=button id="cmd1" onclick="javascript:Test();" value="Add"> .... But the function don't work, because the textbox control isn't...

Get value of a client-side control
i have a webcontrol that has 2 viewstate variables and in the render event handler i write them as hidden input fields, because i need to be able to change them in javascript. the problem is, how can i access the changes made by the javascript? the control is actually a calendar written out as an html table and has 2 links for next/previous month which call javascript functions to change the month and then the table is updated with the new month (with AJAX). now, in my function that gets called an raisecallbackevent i need to know the values of the new month/year so that the javascript can c...

Developed C#.net WebService 1.1 for Client C#.net 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft C#.net Web Services2003 for the Client Application C#.net 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

Get label value after seting from client side
I did with client side set the value of label to some string but whene i try to gete that string from label i get the old value. How can i get that value from server side that i did put from client side ...     Sorry for my bad english..Florim Maxhuni hey cann you post your code. bcoz even if the value of the label has been updated by client side, there shudn't be any difference, so might we can go thru your code and help youDiseirraMark it as an answer, if it helped you anyhow... U can always set and read from a label (span) using client side scripting, But ...

getting client side value in code behind
Dear all, i have declared a variable in client side to hold a particular value..i have to access this variable within pageload evrnt.how can i do it???please suggest   mama Hello, You can make use of Hidden variable, which can be accessed in client side as well as in code behind. I hope this will be helpful..S.SRIRAM hello take a hidden field in your page fill it with ur javascript variable then access the value of hidden field in page loadHAPPY CODINGhttp://shobhitrai.blogspot.com/ Hi It is an easy codding man.. just add runat="server" attribu...

Web resources about - Unable to get the value for RadioButtonList - asp.net.client-side

A2ZMenu tutorial index page
A2Zmenu.Com Blog Tutorials Online Exam Ask Question Utility Fun @ Work Funda Contact Us About Us Loading Test Your Skill Q. Out of Boxing and ...

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 1 Jun 2012

DaniWeb Solved Articles - Technology Publication Meets Social Media
An online discussion community of IT professionals. Forums to get free computer help and support. We are a social technology publication covering ...

.NET sample code - developer Fusion
Discover the very latest .NET sample code Out of the box, the ASP.NET list controls (CheckBoxList, RadioButtonList, DropDownList) only support ...

ConditionalRequiredTextValidator Control
The ConditionalRequiredTextValidator control allows you to specify a CheckBox, RadioButton, CheckBoxList, RadioButtonList, DropDownList, or ListBox ...

ASP.NET 4 and Visual Studio 2010 Web Development Overview : The Official Microsoft ASP.NET Site
This document provides an overview of many of the new features for ASP.NET that are included in the.NET Framework 4 and in Visual Studio 2010. ...

Gaiaware - Gaia Ajax
Home Samples Download Free Trial Buy from $195 Login Download Free Trial ASP.NET Done Right 6 reasons to use Gaia Ajax? 40 UI controls 10 aspects/behaviors ...

A2ZMenu utilities index page
A2Zmenu.Com Blog Tutorials Online Exam Ask Question Utility Fun @ Work Funda Contact Us About Us Loading Online Tool Title Description Rating ...

Online Exam papers index page
A2Zmenu.Com Blog Tutorials Online Exam Ask Question Utility Fun @ Work Funda Contact Us About Us Loading Test Your Skill Q. Out of Boxing and ...

A2ZMenu Experts Comment
A2ZMenu team is committed in providing solution in various technologies through blogs, tutorials, Q & A etc. Our objective is to give a knowledge ...

Resources last updated: 12/8/2015 12:34:47 PM