Search Results

Search found 84 results on 4 pages for 'radiobuttonlist'.

Page 1/4 | 1 2 3 4  | Next Page >

  • Customizing the processing of ListItems for asp:RadioButtonList with "Flow" layout and "Horizontal"

    - by evovision
    Hi, recently I was asked to add an ability to pad specific elements from each other to a certain distance in RadioButtonList control. Not quite common everyday task I would say :)   Ok, let's get started!   Prerequisites: ASP.NET Page having RadioButtonList control with RepeatLayout="Flow" RepeatDirection="Horizontal" properties set.   Implementation:  The underlying data was coming from another source, so the only fast way to add meta information about padding was the text value itself (yes, not very optimal solution): Id = 1, Name = "This is first element" and for padding we agreed to use <space/> meta tag: Id = 2, Name = "<space padcount="30px"/>This is second padded element"   To handle items rendering in RadioButtonList control I've created custom class and subclassed from it:    public class CustomRadioButtonList : RadioButtonList    {        private Action<ListItem, HtmlTextWriter> _preProcess;         protected override void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)        {            if (_preProcess != null)            {                _preProcess(this.Items[repeatIndex], writer);            }             base.RenderItem(itemType, repeatIndex, repeatInfo, writer);        }         public void SetPrePrenderItemFunction(Action<ListItem, HtmlTextWriter> func)        {            _preProcess = func;        }    }   It is pretty straightforward approach, the key is to override RenderItem method. Class has SetPrePrenderItemFunction method which is used to pass custom processing function that takes 2 parameters: ListItem and HtmlTextWriter objects.   Now update existing RadioButtonList control in Default.aspx: add this to beginning of the page:   <%@ Register Namespace="Sample.Controls" TagPrefix="uc1" %>   and update the control to:   <uc1:CustomRadioButtonList ID="customRbl" runat="server" DataValueField="Id" DataTextField="Name"            RepeatLayout="Flow" RepeatDirection="Horizontal"></uc1:CustomRadioButtonList>   Now, from codebehind of the page:   Add regular expression that will be used for parsing:   private Regex _regex = new Regex(@"(?:[<]space padcount\s*?=\s*?(?:'|"")(?<padcount>\d+)(?:(?:\s+)?px)?(?:'|"")\s*?/>)(?<content>.*)?", RegexOptions.IgnoreCase | RegexOptions.Compiled);   and finally setup the processing function in Page_Load:   protected void Page_Load(object sender, EventArgs e)    {        customRbl.DataSource = DataObjects;         customRbl.SetPrePrenderItemFunction((listItem, writer) =>        {            Match match = _regex.Match(listItem.Text);            if (match.Success)            {                writer.Write(string.Format(@"<span style=""padding-left:{0}"">Extreme values: </span>", match.Groups["padcount"].Value + "px"));                 // if you need to pad listitem use code below                //x.Attributes.CssStyle.Add("padding-left", match.Groups["padcount"].Value + "px");                 // remove meta tag from text                listItem.Text = match.Groups["content"].Value;            }        });         customRbl.DataBind();    }   That's it! :)   Run the attached sample application:     P.S.: of course several other approaches could have been used for that purpose including events and the functionality for processing could also be embedded inside control itself. Current solution suits slightly better due some other reasons for situation where it was used, in your case consider this as a kick start for your own implementation :)   Source application: CustomRadioButtonList.zip

    Read the article

  • URL Navigation and SQL Insertion After RadioButtonList Selection

    - by SidC
    Good Morning, I have a radiobuttonlist in my ASP.NET webforms application that is used as a voting tool. The concept is as follows: Users will vote for the blurb in the contentplaceholder using the radiobuttonlist. My list item values are 1 through 3 and my list item text is something like low, medium and high. Questions: 1. I want to save and accumulate votes for a given blurb. The blurb ID is referenced in a meta tag on the content page. How do I reference the meta tag in my SQL insert statement? 2. When the radiobuttonlist is used, can it cause the next content page to be loaded after the SQL insert is done? That is, I don't necessarily want the user to make the radiobuttonlist selection, then have to click a separate button to cast vote and move to next page. I want all that done in the radiobuttonlist. Is this possible? Thanks, Sid

    Read the article

  • jquery select item in radiobuttonlist via client-side function

    - by mcliedtk
    I have the following ASP.NET RadioButtonList: <asp:RadioButtonList ID="rbl" runat="server"> <asp:ListItem Text="Type1" Value="1" /> <asp:ListItem Text="Type2" Value="2" /> </asp:RadioButtonList> I would like to select an item in the list programmatically via a client-side jquery function like this (simplified version): function BindWidget(widget) { // Type property of Widget is an int. $("#<%=rbl.ClientID%>").selectItemByValue(widget.Type); } Ideally, there is some function - in the above code I have proposed selectItemByValue - that selects an item in a RadioButtonList by a given value. Does jquery have a similar function built-in? If not, how should I go about implementing the desired functionality?

    Read the article

  • dynamically created radiobuttonlist

    - by Janet
    Have a master page. The content page has a list with hyperlinks containing request variables. You click on one of the links to go to the page containing the radiobuttonlist (maybe). First problem: When I get to the new page, I use one of the variables to determine whether to add a radiobuttonlist to a placeholder on the page. I tried to do it in page)_load but then couldn't get the values selected. When I played around doing it in preInit, the first time the page is there, I can't get to the page's controls. (Object reference not set to an instance of an object.) I think it has something to do with the MasterPage and page content? The controls aren't instantiated until later? (using vb by the way) Second problem: Say I get that to work, once I hit a button, can I still access the passed request variable to determine the selected item in the radiobuttonlist? Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit 'get sessions for concurrent Dim Master As New MasterPage Master = Me.Master Dim myContent As ContentPlaceHolder = CType(Page.Master.FindControl("ContentPlaceHolder1"), ContentPlaceHolder) If Request("str") = "1" Then Dim myList As dsSql = New dsSql() ''''instantiate the function to get dataset Dim ds As New Data.DataSet ds = myList.dsConSessionTimes(Request("eid")) If ds.Tables("conSessionTimes").Rows.Count > 0 Then Dim conY As Integer = 1 CType(myContent.FindControl("lblSidCount"), Label).Text = ds.Tables("conSessionTimes").Rows.Count.ToString Sorry to be so needy - but maybe someone could direct me to a page with examples? Maybe seeing it would help it make sense? Thanks....JB

    Read the article

  • RadioButtonList.SelectedIndex vs RadioButtonList.SelectedValue

    - by Pinpin
    Out of curiosity, anyone knows the particulars of the internal implementation of ListControl.SelectedIndex = (int) <new valueIndex> VS ListControl.SelectedValue = <new value>.ToString() I'm having difficulties with a custom validation object we've built here to process all validation in one sweep. I suspect using <SelectedValue = > will raise a SelectedIndexChanged event, even though both the value and index remain the same, both before and after the operation. (The ListControl's values are populated declaratively....) As ever, thank you for your time!

    Read the article

  • RadioButtonList confirm SelectedIndexChange

    - by Brian David Berman
    I have a RadioButtonList control and I would like to do a Javascript "confirm" when a user tries to change the index. Currently AutoPostBack is set to TRUE. I can, of course, just call __doPostBack from within a javascript function, etc. I tried a few things with jQuery but you have to worry about mousedown vs. click and then there is always the fact that you can click the checkbox label to select it, etc. Anyone have a nice solution for this? To be clear, I am looking for a way to prompt the user with a confirm box prior to their selection being made and triggering a postback.

    Read the article

  • JavaScript "confirm" on SelectedIndexChange of RadioButtonList

    - by Brian David Berman
    I have a RadioButtonList control and I would like to do a Javascript "confirm" when a user tries to change the index. Currently AutoPostBack is set to TRUE. I can, of course, just call __doPostBack from within a javascript function, etc. I tried a few things with jQuery but you have to worry about mousedown vs. click and then there is always the fact that you can click the checkbox label to select it, etc. Anyone have a nice solution for this? To be clear, I am looking for a way to prompt the user with a confirm box prior to their selection being made and triggering a postback.

    Read the article

  • RadioButtonList javascript firing twice

    - by Muralidhar
    I am working with .NET 1.1. The RadioButtonList's AutoPostBack is set to TRUE. I added a client script to display an alert with the selected value. But, the alert is displaying twice - before and after the post back. Here is the code.. //javascript function getRadioButtonListSelection(radioButtonListId) { var elementRef = document.getElementById(radioButtonListId); var radioButtonListArray = elementRef.getElementsByTagName('input'); var checkedValues = ''; for (var i=0; i<radioButtonListArray.length; i++) { var radioButtonListRef = radioButtonListArray[i]; if ( radioButtonListRef.checked == true ) { checkedValues = radioButtonListRef.value; break; } } alert(checkedValues); } //code behind in Page_load() rbl.Attributes.Add("onclick", "javascript:getRadioButtonListSelection('" + rbl.ClientID + "');"); where could I went wrong?

    Read the article

  • Ajaxcontrol toolkit ConfirmButtonExtender with radiobuttonlist control

    - by chugh97
    I have a Yes/No Radiobutton List, When the asp.net page is loaded, if there are items in the gridview this radio is defaulted to Yes. Now if the user clicks no, I have to delete all the items for the gridview and persist them in db. But I want to show a confimation whether the user wants to go ahead doing this operation. If user clciks Yes then go ahead and delete the rows in gridview if no then keep the original radio setting to Yes. I have been struggling to get this to work as the ConfirmButtonExtender which opens up a modalpopup extender even before I know what has been clicked on the radio. If the radio is preselected with Yes, then if I clcik no, the Modal extender is shown and in the Page PreRender event handler the value of the radio is still Yes and not No as extender is run on click using ajax and it doesnt know the correct value of the radio.Even if I use onClick client side javascript to find out which option has been chosen the difficulty is then executing the server side delete command to the db. Has anyone enconuntered this problem before? Any solutions would be appreciated.

    Read the article

  • ASP.NET RadioButtonList help. If I set a selectedItem, that item doesn't react to SelectedIndexChang

    - by Hcabnettek
    Hi Guys, I have a RadioButtonList on my web form. I have tried two different means to set the selected item. I have tried in the markup, and in code, like the Page_Load event. It sets and displays correctly. My problem is that the selected radio button no longer responds to the SelectedIndexChanged event. The other items works as expected and if I remove the code that sets the selectedItem, then the radio button works as expected. Is there any way I can set a radio button through code, and it still behaves as I would expect. I am guessing, if u force a button to be selected, then it doesn't change. Does anyone know how to rememdey this so I can default select it, but still have it behave the way I want? <asp:RadioButtonList ID="rblPaymentType" runat="server" AutoPostBack="True" RepeatDirection="Horizontal" RepeatLayout="Flow"> <asp:ListItem Value="benefit" Text="Benefit" Selected="True"/> <asp:ListItem Value="expense" Text="Expense" /> </asp:RadioButtonList> This lives inside an ascx which I have an event for public delegate void SwitchBenefitTypeHandler(object sender, EventArgs e); public event SwitchBenefitTypeHandler SwitchedBenefit; protected void Page_Load(object sender, EventArgs e) { WireEvents(); } private void WireEvents() { rblPaymentType.SelectedIndexChanged += (sender, args) => SwitchedBenefit(sender, args); } Then on the aspx, I wire a handler function to that event. if (header is PaymentHeader) (header as PaymentHeader).SwitchedBenefit += (paymentForm as PaymentBaseControl).Update; Finally the handler function public override void Update(object sender, EventArgs e) { if (sender is RadioButtonList) { IsExpense = (sender as RadioButtonList).SelectedValue == "expense"; UpdateCalcFlag(); UpdateDropDownDataSources(); UpdatePaymentTypeDropDown(); ResetBenefitLabels(); FormatAmountTextBox(); } } I hope that's enough code. Everything works great when I don't set the SelectedItem in the RadioButtonList but I need it set. Here's a link to someone with the same problem. It is ASP.NET AJAX related. Click Here Thanks, ~ck in San Diego

    Read the article

  • ASP.NET - How to add a label to a RadioButtonList ListItem?

    - by EWizard
    I have a RadioButtonList with two ListItems included: <asp:RadioButtonList runat="server" ID="optRollover" OnSelectedIndexChanged="RolloverOptionSelected" AutoPostBack="true"> <asp:ListItem Value="0">100% </asp:ListItem> <asp:ListItem Value="1">Less than 100%</asp:ListItem> </asp:RadioButtonList><br /> On the first ListItem I need to have a label that displays some text from the code behind of the page. Logically it seems to me like I would be able to do something like this: 100% Obviously this does not work because I am getting an error: The 'Text' property of 'asp:ListItem' does not allow child objects. Can anyone think of a way around this constraint?

    Read the article

  • Can I add Controls that are not ListItems to a RadioButtonList?

    - by Simon Martin
    I need to provide a way to allow users to select 1 Subject, but the subjects are grouped into Qualifications and so I want to show a heading for each 'group'. My first thought is an asp:RadioButtonList as that provides a list of options from which only one can be selected but there's no means to add break the list up with headings. So I tried the following code - but I can't see that the LiteralControl is being added, which makes me think it's not a valid approach. For Each item As Subject In Qualifications If item.QualCode <> previousQualCode Then rblSelection.Controls.Add(New LiteralControl(item.QualName)) End If rblSelection.Items.Add(New ListItem(item.SubjectName, item.SelectionCode)) previousQualCode = item.QualCode Next

    Read the article

  • Get error when accessing RadioButtonList from javascript that exist in a page that have master page

    - by Space Cracker
    i have a asp.net page that have its master page and it contain RadioButtonList1 and i try to do thefollwing <script type="text/javascript"> var radioButtonList = document.getElementById('<%=RadioButtonList1.ClientID%>'); if(radioButtonList[0].checked) document.getElementById("_secondTR").style.display = "block"; else if (radioButtonList[1].checked ) document.getElementById("_secondTR").style.display = "none"; } </script> <table style="width: 100%"> <tr id="Tr1"> <td> <asp:RadioButtonList ID="RadioButtonList1" runat="server" BackColor="#FFCC99" RepeatDirection="Horizontal" Width="117px" onclick="ShowHide()"> <asp:ListItem Value="1">Yes</asp:ListItem> <asp:ListItem Value="0">No</asp:ListItem> </asp:RadioButtonList> </td> </tr> <tr id="_secondTR" runat="server" style="display: none"> <td> <asp:RadioButton ID="Five" runat="server" GroupName="1" BackColor="#669999" /> <asp:RadioButton ID="Four" runat="server" GroupName="1" CausesValidation="True" BackColor="#669999" /> </td> </tr> </table> i can't get RadioButtonList1 from java script ... could any help me to get that ?

    Read the article

  • jquery get radiobuttonlist by name dynamically

    - by Cindy
    I have two radiobuttonlist and one checkboxlist on the page. Ideally based on the checkbox selected value, I want to enable/disable corresponding radibuttonlist with jquery function. But some how $("input[name*=" + columnName + "]") always return null. It can not find the radiobuttonlist by its name? $(function() { function checkBoxClicked() { var isChecked = $(this).is(":checked"); var columnName = "rblColumn" + $(this).parent().attr("alt"); if (isChecked) { $("input[name*=" + columnName + "]").removeAttr("disabled"); } else { $("input[name*=" + columnName + "]").attr("disabled", "disabled"); $("input[name*=" + columnName + "] input").each(function() { $(this).attr("checked", "") }); } } //intercept any check box click event inside the #list Div $(":checkbox").click(checkBoxClicked); }); <asp:Panel ID="TestPanel" runat="server"> <asp:CheckBoxList ID = "chkColumn" runat="server" RepeatDirection="Horizontal"> <asp:ListItem id = "Column1" runat="server" Text="Column 1" Value="1" alt="1" class="HeadColumn" /> <asp:ListItem id = "Column2" runat="server" Text="Column 2" Value="2" alt="2" class="HeadColumn"/> </asp:CheckBoxList> <table> <tr> <td> <asp:RadioButtonList ID = "rblColumn1" runat="server" RepeatDirection="Vertical" disabled="disabled"> <asp:ListItem id="liColumn1p" runat="server" /> <asp:ListItem id="liColumn1n" runat="server" /> </asp:RadioButtonList> </td> <td> <asp:RadioButtonList ID = "rblColumn2" runat="server" RepeatDirection="Vertical" disabled="disabled"> <asp:ListItem id="liColumn2p" runat="server" /> <asp:ListItem id="liColumn2n" runat="server" /> </asp:RadioButtonList> </td> </tr> </table> </asp:Panel> source: <div id="TestPanel"> <table id="chkColumn" border="0"> <tr> <td><span id="Column1" alt="1" class="HeadColumn"><input id="chkColumn_0" type="checkbox" name="chkColumn$0" /><label for="chkColumn_0">Column 1</label></span></td><td><span id="Column2" alt="2" class="HeadColumn"><input id="chkColumn_1" type="checkbox" name="chkColumn$1" /><label for="chkColumn_1">Column 2</label></span></td> </tr> </table> <table> <tr> <td> <table id="rblColumn1" class="myRadioButtonList" disabled="disabled" border="0"> <tr> <td><span id="liColumn1p"><input id="rblColumn1_0" type="radio" name="rblColumn1" value="" /></span></td> </tr><tr> <td><span id="liColumn1n"><input id="rblColumn1_1" type="radio" name="rblColumn1" value="" /></span></td> </tr> </table> </td> <td> <table id="rblColumn2" class="myRadioButtonList" disabled="disabled" border="0"> <tr> <td><span id="liColumn2p"><input id="rblColumn2_0" type="radio" name="rblColumn2" value="" /></span></td> </tr><tr> <td><span id="liColumn2n"><input id="rblColumn2_1" type="radio" name="rblColumn2" value="" /></span></td> </tr> </table> </td> </tr> </table> </div>

    Read the article

  • Reading the selected value from asp:RadioButtonList using jQuery

    - by digiguru
    I've got code similar to the following... <p><label>Do you have buffet facilities?</label> <asp:RadioButtonList ID="blnBuffetMealFacilities:chk" runat="server"> <asp:ListItem Text="Yes" Value="1"></asp:ListItem> <asp:ListItem Text="No" Value="0"></asp:ListItem> </asp:RadioButtonList></p> <div id="HasBuffet"> <p><label>What is the capacity for the buffet?</label> <asp:RadioButtonList ID="radBuffetCapacity" runat="server"> <asp:ListItem Text="Suitable for upto 30 guests" value="0 to 30"></asp:ListItem> <asp:ListItem Text="Suitable for upto 50 guests" value="30 to 50"></asp:ListItem> <asp:ListItem Text="Suitable for upto 75 guests" value="50 to 75"></asp:ListItem> <asp:ListItem Text="Suitable for upto 100 guests" value="75 to 100"></asp:ListItem> <asp:ListItem Text="Suitable for upto 150 guests" value="100 to 150"></asp:ListItem> <asp:ListItem Text="Suitable for upto 250 guests" value="150 to 250"></asp:ListItem> <asp:ListItem Text="Suitable for upto 400 guests" value="250 to 400"></asp:ListItem> </asp:RadioButtonList></p> </div> I want to capture an event when the radio list blBuffetMealFacilities:chk changes client side and perform a slide down function on the HasBuffet div from jQuery. What's the best way to create this, bearing in mind there are several similar sections on the page, where I want questions to be revealed depending on a yes no answer in a radio list.

    Read the article

  • set Enabled = "false" to radiobuttonlist then can not toggle enable/disable

    - by cindy
    I am able to use jquery toenable/disable radiobuttonlist based on the checkbox value. But the problem is that I want to disable radiobuttonlist at the first time. Then toggle its enable/disable by checkbox later. So I have But after I add: Enabled = "false" to my radiobuttonlist, the toggle of checkbox does not work. Here is my function to toggle : $(function() { function checkBoxClicked() { var isChecked = $(this).is(":checked"); var columnName = "rblColumn" + $(this).parent().attr("alt"); if (isChecked) { $("#" + columnName).removeAttr("disabled"); } else { $("#" + columnName).attr("disabled", "disabled"); } } //intercept any check box click event inside the #list Div $(":checkbox").click(checkBoxClicked); });

    Read the article

  • ASP.NET JSON Binding data with RadiobuttonList

    - by user1385570
    I'm trying to bind JSON data into the RadioButtonList on client side. I know how to do the in code behind, it works fine. Someone please provide more details, How do I bind the JSON data RadioButtionList in VB.NET. rblregions.DataTextField = "Value" rblregions.DataValueField = "Key" rblregions.DataSource = items The data looks like: [regions:{regionID:US,regionName:USA}] main.aspx <asp:RadioButtonList ID="rblregions" runat="server"> $.getJSON("Map/loadMySites.aspx?" + query, function (data) { if (data.regionid && data.region) { //I want to bind the data here with RadioButtonList } } );

    Read the article

  • Selecting radiobuttons populated within asp.net RadioButtonList with jQuery

    - by user194881
    Hello and thanks in advance for the communal help I always find here. I have been tinkering around with what should seem a pretty straight forward task even for a jQuery newb as myself. I have a radiobuttonlist control bound to a collection: <asp:RadioButtonList ID="radBtnLstPackageSelector" runat="server" CssClass="PackageS"> </asp:RadioButtonList> My form does have several other controls of the same type; Now, the challenge is to select and wire up a on Click event for every radiobutton from the radBtnLstPackageSelector. I have tried several approaches such as: var results1 = $(".PackageS").children("input"); var results1 = $(".PackageS").children("input[type=radiobutton"); var results1 = $("table.PackageS > input[type=radiobutton"); with no luck... Your help would be great right now! ~m

    Read the article

  • C#: DataBase Null in RadioButtonList

    - by Vinzcent
    Hey, I would like to have a radiobuttollist were you can select value null. Something like this: <asp:RadioButtonList ID="rblCD" runat="server" SelectedValue='<%# Bind("tblCD") %>'> <asp:ListItem Value="RW">RW</asp:ListItem> <asp:ListItem Value="R">R</asp:ListItem> <asp:ListItem Value="DBNull">None</asp:ListItem> </asp:RadioButtonList> Thanks a lot, Vincent

    Read the article

  • ASP.NET radiobuttonlist onclientclick

    - by Jon
    I've noticed there is no OnClientClick() property for the radiobuttonlist in the ASP.NET control set. Is this a purposeful omissiong on Microsoft's part? Anyway, I've tried to add OnClick to the radio button list like so: For Each li As ListItem In rblSearch.Items li.Attributes.Add("OnClick", "javascript:alert('jon');") Next But alas, it doesn't work. I've even checked the source in firebug, and there is no javascript shown in the radiobuttonlist. Does anyone know how to get this very simple thing working? I'm using ASP.NET control adpaters so don't know if that has anything to do with it. (I wish asp.net/javascript would just work out the box!!!)

    Read the article

  • asp:RadioButtonList doesn't set correct selected item on load

    - by Nir
    I have this code: <asp:RadioButtonList ID="rblExpDate" runat="server" > <asp:ListItem Selected="True" Text="No expiration date"></asp:ListItem> <asp:ListItem Text="Expires on:"></asp:ListItem> </asp:RadioButtonList> that I would like to be always, on page load, to mark the first option ("no expiration date"). However, if the user marks the second option and reloads, the second option is selected, even though I do this on page load: rblExpDate.Items[0].Selected = true; rblExpDate.SelectedIndex = 0; Appreciate your help!

    Read the article

  • Radiobuttonlist and load page in same initial position

    - by Khalid
    Hi I have this simple code in my page, I have a long page, if the client use this button then it shall reload the page and display the page from the beginning. I wish to be reload the page and display from the last position. <asp:RadioButtonList ID="RadioButtonList5" runat="server" AutoPostBack="True" RepeatDirection="Horizontal"> <asp:ListItem Value="45">Sheet2</asp:ListItem> </asp:RadioButtonList> Any advice, apprciated. Thank you.

    Read the article

  • jquery get radiobuttonlist by id dynamically

    - by Cindy
    I have two radiobuttonlist and one checkboxlist on the page. Ideally based on the checkbox selected value, I want to enable/disable corresponding radibuttonlist with jquery function. But some how $("input[name*=" + columnName + "]") always return null. It can not find the radiobuttonlist by its name? $(function() { function checkBoxClicked() { var isChecked = $(this).is(":checked"); var columnName = "rblColumn" + $(this).parent().attr("alt"); if (isChecked) { $("input[name*=" + columnName + "]").removeAttr("disabled"); } else { $("input[name*=" + columnName + "]").attr("disabled", "disabled"); $("input[name*=" + columnName + "] input").each(function() { $(this).attr("checked", "") }); } } //intercept any check box click event inside the #list Div $(":checkbox").click(checkBoxClicked); });

    Read the article

  • get value of dynamiclly created radiobuttonlist

    - by Mark
    Hi All, I'm trying to get the value of a dynamically created radiobuttonlist via javascript to call a pagemethod. This is how I'm creating the rbl: rbl.Attributes["onclick"] = "javascript:preview('" + rbl.ID + "','" + rbl.ClientID + "');"; And this is the javascript: function preview(controlid, clientid) { var radio = document.getElementsByName(clientid); var answer = "k"; for (var ii = 0; ii < radio.length; ii++) { if (radio[ii].checked) answer = radio[ii].value; } PageMethods.SaveAnswer(controlid, answer); } The problem however is that I want to get the groupname of the radiobuttionlist so I can use getElementsByName, but i have no luck so far. Kind regards, Mark

    Read the article

1 2 3 4  | Next Page >