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



Home Answers Viewqa JSP-Servlet Radio Buttons in DB Very Urgent
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ragavendran.R
Radio Buttons in DB Very Urgent
3 Answer(s)      6 years and 4 months ago
Posted in : JSP-Servlet



Advertisement
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
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 
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
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
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
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
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
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 - 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
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... deepak@roseindia.net 8888 deepak kumar It is very urgent for me please give
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
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                   
 

 

 

DMCA.com