Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Get radio button value after submiting page
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


prachiti
Get radio button value after submiting page
1 Answer(s)      3 years ago
Posted in : Java Beginners


Radio buttons are dynamically generated.After selecting radio button & submitting the page , the value of the selected radio button get displayed in that jsp page.

 <% 
    while(rs.next())
      { 

   int Countrycodee = rs.getInt("countrycode"); 
   String countrynamee  = rs.getString("countryname");
   String  statuss   =rs.getString("status");  
          %> 
          <table border="1" width="100%" align="center">    

 <tr>
       <td width="1000">
       <input type= "radio" name="radiobuttonn" value= "<%=Countrycodee%>">

       </td>  

       <td width="1000">
           <%=Countrycodee%>`print("code sample");`
       </td>

       <td width="1000">
       <%=countrynamee%>
     </td>
       <td width="1000">
       <%=statuss%>
     </td>


   </tr>

    </table>



   }

Advertisement
View Answers

October 12, 2011 at 11:33 AM


You have to keep the name attribute same for all radio buttons and you have to use the value attribute also.

1)radio.jsp:

<html>
<form method="post" action="radiobuttonvalue.jsp">
Are you a student? <input type="radio" name="sel" value="yes">Yes<input type="radio" name="sel" value="no">No
<input type="submit" value="submit">
</form>
</html>

2)radiobuttonvalue.jsp:

<% String selectedValue=request.getParameter("sel");
out.println(selectedValue);
%>

For more information, visit the following link:

http://www.roseindia.net/jsp/radio-button-jsp.shtml



Related Tutorials/Questions & Answers:
Get radio button value after submiting page
Get radio button value after submiting page  Radio buttons are dynamically generated.After selecting radio button & submitting the page , the value of the selected radio button get displayed in that jsp page. <
to get radio button value - Struts
to get radio button value   hello friend, i have a problem regarding... two major problems:- 1.these radio button is not going to select also 2.i want to set the "value" attribute of radio button in the above code. Can u help
Advertisements
get a radio button click value - JSP-Servlet
get a radio button click value  thanks sir for sending code ,but i have one probs that is i m getting a null value i m calling getParameter("id... in the input tag name="radio" eventhough i m getting a null value please help me
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  sorry sir my actual probs is that 1st i m callig a jsp in that i m displaying a table where i used a radio button to access a value(also used u r code),then in this jsp i m having a forms
passing value of radio button
passing value of radio button  hi,i have 3 jframe built using the GUi editor in net beans 6.9. i have two radio button in the first jframe.i have to get the selected item appear on the 3rd frame after passing through the second
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  Here is my code sir please help me if any changes in the code please give me sir thanks in advance.. //login.jsp <% EmployeeDataBase employeeDataBase = new
how to get radio value
how to get radio value    how to retrive the option value and insert the next table pls give example
radio button value on edit action
radio button value on edit action  This is my edit.jsp code...In my......Problem 'm facing is on edit action 'm not retrieving radio button value..i have used if else logic..Bt its not working...My edit.jsp code is:-Radio button name
Drop down and radio button value on edit action
i get the value from the database for title and radio button selected...Drop down and radio button value on edit action  HI, I have... the value from dropdown and radio button.. But the problem goes with edit action
Struts 2 radio button value problem
Struts 2 radio button value problem  When I use s:radio tag in struts 2, I'm not able to get the selected value using document.getElementById... gives first radio option's value as the value for any option selected. Ex
Retrieve value of radio button from database to form
Retrieve value of radio button from database to form  var gn=document.getElementsByName("empg"); //empg is name of radio input type. for(var i=0;i
check radio button on retrieving the value from database.
check radio button on retrieving the value from database.  HI i am... database and according to that i want to check the cash cheque radio button... information from database the i want to show cash radio button checked.How can i do
display contents on the same page by selecting a radio button
on the same page under the radio button...display contents on the same page by selecting a radio button  Bill...;input type="radio" name="bill_status " value="due" /> Received<
On selecting a radio button, it should open a jsp page.
On selecting a radio button, it should open a jsp page.  Hi, COuld you please tell me how to link a radio button selection to a jsp. My requirement is if I select a radio button then it should open a jsp page. thank you
pass radio button values to next page
pass radio button values to next page  how to pass selected radio button values which coming from mysql database to next page using php. Please show me with examples
radio button
radio button  On selecting a radio button, it should open a aspx page
Selecting a radio button in jquery autocomplete from database value
Selecting a radio button in jquery autocomplete from database value  ... radio button? Here is the pertinent code: $("#name").autocomplete... to do is to select the appropriate radio button. Any pointers please
How to use radio button in jsp page
How to use radio button in jsp page  ... button in jsp code and display a message in another jsp page according to selected radio buttons. First page in this example lets the user enter its name
when radio button is selected corresponding jsp page should open
when radio button is selected corresponding jsp page should open  how...="form"> View Profile<input type="radio" value="view" name="radios" onclick="openPage();"><br> Edit Profile<input type="radio" value="edit" name
How to add radio button value in a table for particular field?
How to add radio button value in a table for particular field?  Hi,I... one radio button for text field then it insert only one value absent OR present... dynamically from other table and two radio button one for present and the second
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page  hi.. the code below here there are list of radio buttons here in jsp page when the values...; <input name="radiobutton" type="radio" value="radiobutton" />
HTML Get Radio Button
HTML Get Radio Button     .... When a page is submiited,the value entered by the user is visible to the user in URL. Understand with Example The Tutorial illustrates an HTML Get Radio Button
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page  hi.. the code below here there are list of radio buttons here in jsp page when the values...; <input name="radiobutton" type="radio" value="radiobutton" />
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page  hi.. the code below here there are list of radio buttons here in jsp page when the values...; <input name="radiobutton" type="radio" value="radiobutton" />
Radio Button in Java
Radio Button in Java       Radio Button is a circular button on web page that can be selected by the user. The AWT  Widget used to create a radio button is Checkbox
Query on radio button
Query on radio button  I am having a multiple row in jsp page.They are dynamically coming. For each row there is one radio button. I want to select one row only, i.e I want to fetch the value of row and on submitting the page
radio button - Development process
but when i click on cr radio button and enter value in text box.it enter the msg but it again go to sr radio button   Hi friend, Plz give full...radio button  hi, there is 2 radio button and five text box
how to check the radio button automatically depending up on the value of database when editing the form...
how to check the radio button automatically depending up on the value... button. When the user clicks the particular radio button, that data will get shown... to highlight the radio button from the database.......nd even list box also can any
Radio Button Problem in jsp.
Radio Button Problem in jsp.  I have a small doubt in my application, my requirement is to get a "single selectible row", I generated a radio button...="radio" value="<%=rs.getString("op1")%>" name="radio<%=i%>"/><
session value not get in many jsp page.
session value not get in many jsp page.  I am using servlet to set...,response); and get session value on jsp page by follwing:- String user=(String... page its give null value
Using radio button in struts - Struts
, but the radio button has only just one value that i can pass.what can i do to solve...Using radio button in struts  Hello to all , I have a big problem... options to choose : Serial number 12345 radio button - selection 1 radio button
Advertisements
 

 

 

DMCA.com