Radio Buttons in DB Very Urgent

Radio Buttons in DB Very Urgent

View Answers

July 25, 2008 at 7:11 PM

hi friend,

<%@ page language="java" %>

<%@ page import="java.lang.*" %>

<%@ page import="java.sql.*" %>



<HTML>

<head>



</head>

<BODY BGCOLOR="LIGHTYELLOW">

<%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

//Connection con=DriverManager.getConnection("jdbc:odbc:Employee","","");

Statement stmt=null;

%>

<FORM NAME="form" METHOD="GET" ACTION="process.jsp">





<H3> <P ALIGN="CENTER"> <FONT SIZE=6> EMPLOYEE DETAILS </FONT> </P> </H3> </BR> </BR>

<BR>

<BR>

<TABLE CELLSPACING=5 CELLPADDING=5 BGCOLOR="LIGHTBLUE" COLSPAN=2 ROWSPAN=2 ALIGN="CENTER">

<TR>

<TD> <FONT SIZE=5> Enter Employee ID </TD> <TD> <INPUT TYPE="TEXT" NAME="id" id="emp_id"> </TD> <TD> <INPUT TYPE="button" NAME="s1" VALUE="View Database" onClick="window.open('winopenradio.jsp','mywindow','width=500,height=350,toolbar=no,resizable=yes,menubar=yes')">

</FONT> </TD>

</TR>

<TR>

<TD> <FONT SIZE=5> Enter Employee Name </TD>

<TD><INPUT TYPE="TEXT" NAME="name" id="emp_name">

</FONT> </TD>

</TR>

<TR>

<TD> <FONT SIZE=5> Enter New Name (For UPDATE only) </TD>

<TD><INPUT TYPE="TEXT" NAME="nname"> </FONT> </TD>

</FONT> </TR>

<TR> <FONT SIZE=6>

<TD> <INPUT TYPE="SUBMIT" NAME="s1" VALUE="Insert">

<INPUT TYPE="SUBMIT" NAME="s1" VALUE="Delete">

<INPUT TYPE="SUBMIT" NAME="s1" VALUE="Update">

<INPUT TYPE="SUBMIT" NAME="s1" VALUE="Query"> </TD>

</TR> </FONT>

<%

if(session.getAttribute("empcode") !=null && session.getAttribute("empname") !=null) { %>

<script language="javascript">

document.getElementById('id').value=<%=session.getAttribute("empcode").toString()%>

document.getElementById('name').value='<%=session.getAttribute("empname").toString()%>'

</script>

<%

session.removeAttribute("empcode");

session.removeAttribute("empname");

}



%>

</FORM>

</BODY>

</HTML>

July 25, 2008 at 7:14 PM

<%@ page import="java.sql.*" %>

<html>

<head>

<script type="text/javascript">

function trim(stringToTrim) {

return stringToTrim.replace(/^\s+|\s+$/g,"");

}



function validate()

{

var emp_value ="";

for (var i=0; i < document.employee.empid.length; i++)

{

if (document.employee.empid[i].checked)

{

var emp_value = document.employee.empid[i].value;

}

}



if(emp_value=="" || emp_value==null)

{

alert("Please select Employee Id");

return false;

}

return true



}





function showEmp()

{

if(validate()){

for (var i=0; i < document.employee.empid.length; i++)

{

if (document.employee.empid[i].checked)

{

var emp_value = document.employee.empid[i].value;

}

}







xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)

{

alert ("Browser does not support HTTP Request")

return

}

var url="getuser.jsp"

url=url+"?emp_id="+emp_value;



xmlHttp.onreadystatechange=stateChanged

xmlHttp.open("GET",url,true)

xmlHttp.send(null)

}





}



function stateChanged()

{





if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

{



var showdata = xmlHttp.responseText;

var strar = trim(showdata).split(":");



if(strar.length>0)

{

window.opener.location.reload();

window.location.reload();

window.close();

opener.document.getElementById("emp_id").value=strar[1];

opener.document.getElementById("emp_name").value=strar[0];

window.close();

}

}

}



function GetXmlHttpObject()

{

var xmlHttp=null;

try

{

// Firefox, Opera 8.0+, Safari

xmlHttp=new XMLHttpRequest();

}

catch (e)

{

//Internet Explorer

try

{

xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

}

catch (e)

{

xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

}

}

return xmlHttp;



}

</script>

</head>

<body>

<form name="employee">

<br><br>

<table border="0" width="400px" align="center" bgcolor="#CDFFFF">

<tr><td align="center" colspan=2><b>Select Employee Id</b></td></tr>

July 25, 2008 at 7:15 PM

<%

Connection conn = null;

String url = "jdbc:mysql://localhost:3306/";;

String dbName = "user_register";

String driver = "com.mysql.jdbc.Driver";

String userName = "root";

String password = "root";



int sumcount=0;

Statement st;

try {

Class.forName(driver).newInstance();



conn = DriverManager.getConnection(url+dbName,userName,password);

String query = "select * from employee_details";



st = conn.createStatement();

ResultSet rs = st.executeQuery(query);

%>



<%

while(rs.next())

{

%>



<tr><td align="center" width="50%"><input type="radio" name="empid" value=<%=rs.getString(1)%>><%=rs.getString(1)%></td><td width="50%"><%=rs.getString(2)%></td></tr>



<%

}

%>



<%



}

catch (Exception e) {

e.printStackTrace();

}



%>



<tr><td align="center" width="50%"><input type="button" value="Select" onclick="javascript:showEmp();"</td></tr>



</table>

</form>

</body>

</html>

---------------------------------------------
Read for more information.

http://www.roseindia.net/jsp/

Thanks









Related Tutorials/Questions & Answers:
Radio Buttons in DB Very Urgent - JSP-Servlet
Radio Buttons in DB Very Urgent  Respected Sir/Madam, I am... in the database.Here I need Radio Buttons added dynamically for each Row. When I click... Very Urgent.. Please send
Display Label and radio buttons runtime with respect to DB values
Display Label and radio buttons runtime with respect to DB values  Requirement: I am getting alertCondition,Y,W values from DB the the cooresponding... can we get selected values of radiobuttons at runtime and updated back to DB
Advertisements
Image selection instead of radio button very urgent.. - JSP-Servlet
Image selection instead of radio button very urgent..  Respected Sir/Madam, I am R.Ragavendran.. Actually in the following using radio... of this radio button. There must be an arrow or icon for each Emp ID. The color
radio buttons
radio buttons  write a program to create an applet button which has a list of radio buttons with titles of various colours.set the background colour... has a list of radio buttons with titles of various colors and a button
very urgent
very urgent  ** how to integrate struts1.3 ,ejb3,mysql5.0 in jboss server with myeclipse IDE
3 RADIO BUTTONS
3 RADIO BUTTONS  3 RADIO BUTTONS USING ALSO ONE RADIO CLICKING HOW TO PROCESS OF NEXTPAGE
Radio Buttons - Java Beginners
Radio Buttons  Hello Sir, How to create the code for the password... the radion buttons in display the same page in jsp.I need only how to make the question and answer page using the radio buttons.please help me to solve
Radio Buttons in Jsp - JSP-Servlet
Radio Buttons in Jsp  Hi, i have a page in which there are lot of radio buttons [IMG]http://i38.tinypic.com/jzi6vc.jpg[/IMG] see the above picture..." depending on the value in the String radio button has to be checked. How to do
Pop up Very Very Urgent - JSP-Servlet
='' Its Very Urgent.. Please send me the coding asap.. Thanks...Pop up Very Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. I got your reply.. Thank you very much for the response. Now I am sending
Very Very Urgent -Image - JSP-Servlet
Very Very Urgent -Image  Respected Sir/Madam, I am... with some coding, its better.. PLEASE SEND ME THE CODING ASAP BECAUSE ITS VERY VERY URGENT.. Thanks/Regards, R.Ragavendran...  Hi friend, Code
Help Very Very Urgent - JSP-Servlet
requirements.. Please please Its Very very very very very urgent... Thanks...Help Very Very Urgent  Respected Sir/Madam, I am sorry..Actually the link u have sent was not my actual requirement.. So,I send my requirement
Program Very Urgent.. - JSP-Servlet
Program Very Urgent..  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your superb reply. I got the link you sent. But I find a simple problem... its most urgent.. Thanks/Regards, R.Ragavendran..   Hi friend
JSP and AJAX- very urgent - Ajax
Plz its very very Urgent.. Regards, Ragavendran...JSP and AJAX- very urgent  Respected Sir/Madam, I am Ragavendran.. I have a simple doubt.. At present, I am in a module of the project
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
JSP,JDBC and HTML(Very Urgent)  Respected Sir/Madam, Thanks... in the database. The same page must also consists of four radio buttons 1)Insert,2... to ROSEINDIA team.. This is Very Urgent. Plz Plz send me the coding ASAP
JSP and AJAX very urgent - Ajax
JSP and AJAX very urgent  Hi Team, This is Ragavendran.R.. I have a very basic doubt in AJAX. While Using AJAX, of course, there will be tag involved in JSP page. But in my current project, I am using too many tags
WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS - Struts
for check boxes and radio buttons and for submit buttons. i have a jsp page which contains check boxes,radio buttons.and when i click submit button the related...WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS 
its very urgent please help me
its very urgent please help me  how can i retrieve all images from ms access database and display in jsp pages
Ple help me its very urgent
Ple help me its very urgent  Hi.. I have one string 1)'2,3,4' i want do like this '2','3','4' ple help me very urgent
Simple Program Very Urgent.. - JSP-Servlet
Simple Program Very Urgent..  Respected Sir/Madam, I am... coding asap because its most urgent.. Thanks/Regards, R.Ragavendran..  .... First Select Radio Button of the corresponding Employee Id. 2. Click
very urgent, want to submit my project on monday
very urgent, want to submit my project on monday  i have the code for connected combo-boxes(jsp). But the thing i want to know is, how to access the values selected in those combo-boxes, for storing in database. in the case
very urgent - Java Server Faces Questions
check it once and give me a correct solution. It is very urgent for me. Thanks...very urgent  Hi sir, yesterday i send total my code to find where i have done mistake ,you send a reply for that also but in that you told remove
Basic problem but very urgent - JSP-Servlet
Basic problem but very urgent  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your superb reply. I got the link you sent. But I find a simple... me the cause of the problem asap because its most urgent.. Thanks/Regards
very urgent - Java Server Faces Questions
very urgent  Hi sir, see my code and please tell me mistake. it is very urgent for me. here is my code: addmin.jsp: Users... [email protected] 8888 deepak kumar It is very urgent for me please give
Programming help Very Urgent - JSP-Servlet
Please please its very urgent.. Thanks/Regards, R.Ragavendran..  ...Programming help Very Urgent  Respected Sir/Madam, Actually my code shows the following output: There is a combo box which contains all the ID's
Popup very urgent plz - JSP-Servlet
Popup very urgent plz  Respected Sir/Madam, I am R.Ragavendran.. I got your reply.. Thank you very much for the response. Now I am sending the code...='' Its Very Urgent.. Please send me the coding asap.. Thanks/Regards
&nbsp;(very urgent) - Design concepts & design patterns
 (very urgent)  hi friends, This is my code in html                   
&nbsp;(very urgent) - Java Server Faces Questions
 (very urgent)  hi friends, This is my code in JSF                    
Validating Number Very Urgent - JSP-Servlet
Validating Number Very Urgent  Respected Sir/Madam, I am...('id').value= document.getElementById('name').value='' Its Very Urgent.. Please send me the coding asap.. Thanks/Regards, R.Ragavendran.. 
Simple problem Very Urgent - JSP-Servlet
Simple problem Very Urgent  Respected SDir/Madam, I am R.ragavendran.. Thanks for your superb reply. I got the coding. But I find a simple... with database values. But when i select by clicking a radio button and clicking
Very urgent Image Selection - JSP-Servlet
Very urgent Image Selection  Respected Sir/Madam, I am R.Ragavendran.. If you are telling that your coding works fine, then can u plz tell me or send me the output of the following code asap? var imageURL
Tab sequence problem with Radio buttons - JSP-Servlet
Tab sequence problem with Radio buttons  Hi, I have membership type in application as 1 year(radio button) 2 year(radio button) 4 year(radio button) courier delivery courier(radio button) currently tab sequence going
prog. using radio buttons for simple calculator
prog. using radio buttons for simple calculator  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Calculator extends JFrame { private final Font BIGGER_FONT = new Font
prog. using radio buttons for simple calculator
prog. using radio buttons for simple calculator  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Calculator extends JFrame { private final Font BIGGER_FONT = new Font
Please help me... its very urgent
Please help me... its very urgent  Please send me a java code to check whether INNODB is installed in mysql... If it is there, then we need to calculate the number of disks used by mysql
Java radio buttons and button groups two values
Java radio buttons and button groups two values  hi i have a problem. i have a system to input data from a jform to a mysql database. i have made all of it except the gender radiobuttons. how do i do this? i need when register
Java radio buttons and button groups two values
Java radio buttons and button groups two values  hi i have a problem. i have a system to input data from a jform to a mysql database. i have made all of it except the gender radiobuttons. how do i do this? i need when register
very urgent - Design concepts & design patterns
very urgent  Hi friends, I have a page layout with a menu on the left, the menu looks perfect in my personal system but the spacing and the rollover effect is all messed up in server system. How can i fix this : I only have
plz help -java project very urgent
plz help -java project very urgent  ? Ford furniture is a local furniture store in acts, and they as CS graduate students to implement a software system to generate various reports for them at the end of each month. You
need help for writting code in struts action class for check boxes and radio buttons - Struts
people.iwould like to write code in struts action class for check boxes and radio buttons and for submit buttons. i have a jsp page which contains check boxes,radio...need help for writting code in struts action class for check boxes and radio
URGENT: Export Table in Oracle db to CSV file
URGENT: Export Table in Oracle db to CSV file  Hi, Could you basically help me by providing a program in Java. I want a program to connect and export a table in the oracle database to a folder in my local harddrive. Thankyou
inserting data from radio buttons to database - JSP-Servlet
inserting data from radio buttons to database  hi, i am getting error in my code of feedback form. once i finished selecting all the radio buttons and when i click on delete button. it points to the answer.jsp. answer.jsp
inserting data from radio buttons to database - JSP-Servlet
inserting data from radio buttons to database  hi, my problem... of radio buttons. the feedback.jsp should look like same as follows: Please... as per his choice. when user completes all the selection of radio buttons and he
Buttons
Buttons  I have created a web page with radio button group with two radio buttons for accepting the home appliances categories,Kitchen appliances... radio button is selected.Which event listener do I need to implement for this task
inserting data from radio buttons to database-ERROR - JSP-Servlet
inserting data from radio buttons to database-ERROR  hi, i have already changed the option field of table question. the code which you give me has the option field as options. but it is option in the table,so i changed
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
Radio Buttons in HTML
Radio Buttons in HTML     ..._TO_REPLACE_1 The Tutorial illustrates an example from Radio Buttons in HTML.In this Tutorial, the code explain to create a Radio Buttons. The code enables a user
I am getting Undefined in Text Box Very Urgent - JSP-Servlet
I am getting Undefined in Text Box Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your superb reply. I got the coding. But I find... is opening with database values. But when i select by clicking a radio button
Radio buttons in html
Radio buttons in html Here is an example of radio button in html.In this example we have display two radio button Male and Female. The user select only one...;b>radio buttons in html</b></font></center></td> <
Create Radio Buttons in SWT
Create Radio Buttons in SWT       This section illustrates you how to create radio button. In SWT, the style RADIO defined in the Button class allows to create radio button. We
how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL
how to access radio buttons selected in a servlet??...iam unable to retrieve...; <p>4.what is currency of USA?</p> <input type="radio...; <input type="radio" name="d" onclick="getAnswer('b')" value="b "/>pound

Ads