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 servlet that is used in another jsp so can i call getParameter("radio") i.e in the input tag name="radio" eventhough i m getting a null value please help me sir
thanks in advance
if an changes in the code please send me sir...
1)Home.jsp:
<%@ page import="java.sql.*"%>
<script>
function transfer(id){
var f = document.form;
f.method = "POST";
f.action = "main.jsp?id="+id;
f.submit();
}
</script>
<form name="form">
<table border=1>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root","root";);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from data");
while(rs.next()){
%>
<tr><td><input type="radio" name="radio" value="<%=rs.getString("id")%>" onclick="transfer(<%=rs.getString(1)%>);"></td><td><%=rs.getString("id")%></td><td><%=rs.getString("name")%></td></tr>
<%
}
}
catch(Exception e){}
%>
</table>
</form>
2) main.jsp:
<%
String id=request.getParameter("id");
out.println("id = "+id);
%>
View Answers
April 16, 2010 at 12:33 PM
Hi Friend,
If you want to call servlet from another jsp i.e 'main.jsp', then you have to store the value of id in main.jsp using the following:
<input type="hidden" name="idvalue" value="<%=id%>">
In servlet, use the following code to retrieve value of id:
String id=request.getParameter("idvalue");
Hope that it will be helpful.
Thanks
Related Tutorials/Questions & Answers:
get a radio button click value - JSP-Servletget 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
to get radio button value - Strutsto
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 radio button value after submiting pageGet 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.
<
get a value when a radio button clicked - JSP-Servletget 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 buttonpassing
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
how to get radio value how to
get radio value how to retrive the option
value and insert the next table pls
give example
Struts 2 radio button value problemStruts 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
radio button value on edit actionradio 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
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
How to hide and show some field on a radio button clickHow to hide and show some field on a
radio button click This is my... TYPE=
radio NAME="payment_method"
VALUE="cash" CHECKED><b class="label">... and cheque number label and textbox to be invisible when by cash
radio button radio buttonradio button On selecting a
radio button, it should open a aspx 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
HTML Get Radio Button
HTML
Get Radio Button
...
Radio Button example. In this Tutorial
we create a
radio button, which allows the user to select any one of
radio
button from the alternative option. When
passing values on button clickpassing values on
button click Please help me to solve this issue.I want to pass a
value assigned to
button to another view upon
button click in xcode
iPhone Radio Button Example click on that
button it
get selected and by default it should display unselected...iPhone
Radio Button Example Can you please suggest me how to create
Radio button in my iPhone application. Actually, in my application i have two
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 jquery button clickjquery
button click jquery
button click - I have created a
button in JQuery but the problem is that it's not detecting
click. What could...;
<input id="Button1" type="
button"
value="
button" />
Query on radio buttonQuery 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 ValidationRadio button Validation Hi..
How to validate
radio button in java?if the
radio button is not selected an error message should be given...
Please...()==false)){
JOptionPane.showMessageDialog(null,"Please select
radio button Dojo Radio Button must select exactly only one choice from a group
of
radio button.
Click a non...Dojo
Radio Button
.... For creating
radio button you need "dijit.form.CheckBox".
The
radio validation of radio buttonvalidation of
radio button There are 3
radio button as A,B,W. there are another
radio as 1,2,3.if we select W in first
radio button then should select 2nd one(1,2,3).if we select A or B not need select any one from 1,2,3
iphone button click eventiphone
button click event Hi,
How to write iphone
button click event?
Thanks
Hi,
Here the method declaration:
-(IBAction) myMetod...{
NSLog(@"
Button clicked");
}
Thanks
Struts 2 Radio Button radio buttons and
I am using Struts2 tag.I want first rado
button to be selected by default.But when i select the second
radio button and hit on search
button i want to retain the selection of that second
radio button on search list
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%>"/><
Radio Button in HTML is written by the text next to the
radio button. It is not the
value attribute...;
<form action="">
<input type="
radio" name="
Button"
value="Water"> Water<br>
<input type="
radio" name="
Button"
value="Beer">
java radio button and exceptionjava
radio button and exception Dear Sir/Madam,
I have problem with my addBagelRadioButton and addCheeseRadioButton. There should be only 1
radio button can be selected, but somehow 2 can be selected the same time. Also, I
dependent radio button of the
Radio Button is to select only one option at a time. So you don't need...dependent
radio button Hi. I have 4
radio buttons say all,chocolate,cookie,icecream. If I select all the other 3 should not able to be selected
radio button - Development processradio button hello,i want to creat two
radio button.out of which only one can be selected.and can show the contain of selected
radio box Hi friend,
Code to solve the problem :
My Page
Radio 11
access into radio buttonaccess into
radio button access the four fields of database called access,access file and stored in
radio button.please help
JFrame Button click to start playJFrame
Button click to start play i made a game and and i add a
button in new jframe and i want when i
click it it start to play...can anyone help me
Radio button in JSP - JSP-ServletRadio button in JSP Hi!
In my page I have two
radio buttons.
If i select first
radio button. one text field has to be displayed....
If i select second
radio button. text field has to be disappeared.
pls.... help me..
Radio button validation using jsp - JSP-ServletRadio button validation using jsp I had one jsp Page and servlet. I did my validations in servlet for my jsp page which contains the
radio... a
value for
radio Buttons) then it will return to same jsp page with the given
radio button in jsp - JSP-Servletradio button in jsp hye there.how do I create
radio button in jsp?Could you please gimme an example of shopping cart in jsp which have I have using a Netbean not a tomcat.What is the code for view and update in jsp?Thanks
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