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. How to get value from dynamic radio button

How to get value from dynamic radio button

Scheduled Pinned Locked Moved ASP.NET
questiontutorialdatabaseoraclesysadmin
4 Posts 3 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.
  • G Offline
    G Offline
    gaigoi113
    wrote on last edited by
    #1

    Hi All, I'm working on a online survey. What I have accomplished is reading the table A (contain Question) and table B (contain Answer). I used Response.write() to format it to look like Section 1 ------------- Question 1 | Answer 1 | Answer 2 | Answer 3 | Answer 4 | Answer 5 Response.Write("<input id='" & "rad" & radIDCount & "' name='" & subDataReader("QUESTION_ID") & "' type='radio' value='" & subDataReader("ANSWER_ID") & "' runat='server'/>") How do I loop thru all the radio button and submit the answer to the oracle database? I tried the FindControl but i get no luck. Someone guide me to the right direction? thanks

    C S 2 Replies Last reply
    0
    • G gaigoi113

      Hi All, I'm working on a online survey. What I have accomplished is reading the table A (contain Question) and table B (contain Answer). I used Response.write() to format it to look like Section 1 ------------- Question 1 | Answer 1 | Answer 2 | Answer 3 | Answer 4 | Answer 5 Response.Write("<input id='" & "rad" & radIDCount & "' name='" & subDataReader("QUESTION_ID") & "' type='radio' value='" & subDataReader("ANSWER_ID") & "' runat='server'/>") How do I loop thru all the radio button and submit the answer to the oracle database? I tried the FindControl but i get no luck. Someone guide me to the right direction? thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      STI06 wrote:

      How do I loop thru all the radio button and submit the answer to the oracle database?

      Given that you don't create any sort of server controls at all, your only chance is if you look at the form variables and can find the one for your radio button by name in there.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • G gaigoi113

        Hi All, I'm working on a online survey. What I have accomplished is reading the table A (contain Question) and table B (contain Answer). I used Response.write() to format it to look like Section 1 ------------- Question 1 | Answer 1 | Answer 2 | Answer 3 | Answer 4 | Answer 5 Response.Write("<input id='" & "rad" & radIDCount & "' name='" & subDataReader("QUESTION_ID") & "' type='radio' value='" & subDataReader("ANSWER_ID") & "' runat='server'/>") How do I loop thru all the radio button and submit the answer to the oracle database? I tried the FindControl but i get no luck. Someone guide me to the right direction? thanks

        S Offline
        S Offline
        S Dhanasekaran
        wrote on last edited by
        #3

        Hi, can u explain briefly? which datacontrol used to bind the value?

        G 1 Reply Last reply
        0
        • S S Dhanasekaran

          Hi, can u explain briefly? which datacontrol used to bind the value?

          G Offline
          G Offline
          gaigoi113
          wrote on last edited by
          #4

          thanks for reply. I have add the placeholder at Page_load and now I'm able to the find control. How do I check the value of the radio button in the FindControl? Dim radValue As New RadioButton radValue = phControl.FindControl("rad1") If radValue.Checked = True Then Response.Write("I'm selected") End If Now I want to find the value of the radio button. any help?

          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