Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. radiobuttonlist and asp.net2.0

radiobuttonlist and asp.net2.0

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadmin
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ritu4321
    wrote on last edited by
    #1

    <asp:RadioButtonList ID="rdDateSelection" visible="true" AutoPostBack="true" runat="server" RepeatDirection="vertical" > <asp:ListItem Value="Today">Today</asp:ListItem> <asp:ListItem Value="FromToDate">From </asp:ListItem> </asp:RadioButtonList> through javascripting i want ot find out which radio the user has clicked .

    I S 3 Replies Last reply
    0
    • R ritu4321

      <asp:RadioButtonList ID="rdDateSelection" visible="true" AutoPostBack="true" runat="server" RepeatDirection="vertical" > <asp:ListItem Value="Today">Today</asp:ListItem> <asp:ListItem Value="FromToDate">From </asp:ListItem> </asp:RadioButtonList> through javascripting i want ot find out which radio the user has clicked .

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      var value=rdDateSelection.Options[rdDateSelection.selectedIndex].value; //Check value if(value=="Today") //do something here else //here

      please don't forget to vote on the post that helped you.

      R 1 Reply Last reply
      0
      • I Imran Khan Pathan

        var value=rdDateSelection.Options[rdDateSelection.selectedIndex].value; //Check value if(value=="Today") //do something here else //here

        please don't forget to vote on the post that helped you.

        R Offline
        R Offline
        ritu4321
        wrote on last edited by
        #3

        Options is giving null some error

        1 Reply Last reply
        0
        • R ritu4321

          <asp:RadioButtonList ID="rdDateSelection" visible="true" AutoPostBack="true" runat="server" RepeatDirection="vertical" > <asp:ListItem Value="Today">Today</asp:ListItem> <asp:ListItem Value="FromToDate">From </asp:ListItem> </asp:RadioButtonList> through javascripting i want ot find out which radio the user has clicked .

          S Offline
          S Offline
          soni uma
          wrote on last edited by
          #4

          Get a idea from following script SCRIPT LANGUAGE="JavaScript"> function testButton (form){ for (Count = 0; Count < 3; Count++) { if (form.rad[Count].checked) break; } alert ("Button " + Count + " is selected"); } onClick="testButton(this.form)">

          :-\

          1 Reply Last reply
          0
          • R ritu4321

            <asp:RadioButtonList ID="rdDateSelection" visible="true" AutoPostBack="true" runat="server" RepeatDirection="vertical" > <asp:ListItem Value="Today">Today</asp:ListItem> <asp:ListItem Value="FromToDate">From </asp:ListItem> </asp:RadioButtonList> through javascripting i want ot find out which radio the user has clicked .

            S Offline
            S Offline
            soni uma
            wrote on last edited by
            #5

            Try this it is working fine function getCheckedRadio() { var radioButtons = document.getElementsByName("rblCustomer"); for (var x = 0; x < radioButtons.length; x ++) { if (radioButtons[x].checked) { alert("You checked " + radioButtons[x].id + " which has the value " + radioButtons[x].value); } } }

            Today FromToDate :-\

            S 1 Reply Last reply
            0
            • S soni uma

              Try this it is working fine function getCheckedRadio() { var radioButtons = document.getElementsByName("rblCustomer"); for (var x = 0; x < radioButtons.length; x ++) { if (radioButtons[x].checked) { alert("You checked " + radioButtons[x].id + " which has the value " + radioButtons[x].value); } } }

              Today FromToDate :-\

              S Offline
              S Offline
              sandesh khare
              wrote on last edited by
              #6

              hi, Try this... its working function mytest() { var rdolist = document.getElementsByName("RadioButtonList1"); if (rdolist[1].checked) alert("1"); if (rdolist[2].checked) alert("2"); if (rdolist[3].checked) alert("3"); return true; } protected void Page_Load(object sender, EventArgs e) { RadioButtonList1.Attributes.Add("onclick", "javascript: return mytest();"); }

              sandesh

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups