Validating Number Very Urgent

Validating Number Very Urgent

View Answers

August 11, 2008 at 3:15 PM

wat do u want to check?
if u want to insert number only in the emp id field...then u can u use this...
<%@ page language="java" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.sql.*" %>

<HTML>
<BODY BGCOLOR="LIGHTYELLOW">
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:Employee","","");
Statement stmt=null;
%>
<FORM NAME="form"




onSubmit="return checkban()"





METHOD="GET" ACTION="process.jsp">



<script language="javascript">
function Validate() {





var anum=/(^\d+$)|(^\d+\.\d+$)/
if (anum.test(phone))
return true
else{
alert("Please input valid emp no!")
return false
}






if(form.id.value=="") {
alert("Employee ID cannot be null");
form.id.focus();
return false;
}
if(form.name.value=="") {
alert("Employee Name cannot be null");
form.name.focus();
return false;
}
return true;
}
function Valid() {
if(form.id.value=="") {
alert("Employee ID cannot be null");
form.id.focus();
return false;
}
return true;
}
function check() {
if(form.id.value=="") {
alert("Employee ID cannot be null");
form.id.focus();
return false;
}
if(form.nname.value=="") {
alert("Please Enter a name to be modified");
form.nname.focus();
return false;
}
return true;
}
</script>








<script>
function checkban(){
if (document.layers||document.all||document.getElementById)
return Validate()
else
return true
}
</script>







<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" value=""> </TD> <TD> <INPUT TYPE="BUTTON" VALUE="View Database" onClick="window.open('Database.jsp','mywindow','width=500,height=350,toolbar=no,resizable=no,scrollbars=1')">
</FONT> </TD>
</TR>
<TR>
<TD> <FONT SIZE=5> Enter Employee Name </TD>
<TD><INPUT TYPE="TEXT" NAME="name" id="emp_name" value="">
</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="RESET" NAME="re" VALUE="Reset"> </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>





I have added some code and made some changes....whereevr i made changes i hav inserted linebreaks...

hope it solve the problem,....


thanks and regards
prashu









Related Tutorials/Questions & Answers:
Validating Number Very Urgent - JSP-Servlet
Validating Number Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. I want u to insert the coding for validating number in the place...('id').value= document.getElementById('name').value='' Its Very
very urgent
very urgent  ** how to integrate struts1.3 ,ejb3,mysql5.0 in jboss server with myeclipse IDE
Advertisements
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 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
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
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
JSP,JDBC and HTML(Very Urgent)  Respected Sir/Madam, Thanks... exact requirement in which if I get an immediate help,I will be very much grateful to ROSEINDIA team.. This is Very Urgent. Plz Plz send me the coding ASAP
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
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
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) - Java Server Faces Questions
 (very urgent)  hi friends, This is my code in JSF                    
&nbsp;(very urgent) - Design concepts & design patterns
 (very urgent)  hi friends, This is my code in html                   
Radio Buttons in DB Very Urgent - JSP-Servlet
Very Urgent.. Please send...Radio Buttons in DB Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. I got your reply.. Thank you very much for the response. Now I am sending
Simple Program Very Urgent.. - JSP-Servlet
Simple Program Very Urgent..  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your superb reply. I find a simple problem which i have tried my... coding asap because its most urgent.. Thanks/Regards, R.Ragavendran..  
plz help -java project very urgent
plz help -java project very urgent  ? Ford furniture is a local... the furniture ordered by the total number of sales with the following info: name, id, total number of sales, total sales, total original price Step 3: Generate a report
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
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
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 problem which i hava tried my level best to solve. A pop up window is opening
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
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 button to select Emp ID which is getting populated in the text box of my home page
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 a simple problem which i hava tried my level best to solve. A pop up window
validating a HTML
validating a HTML  What are the reasons for validating a HTML
Urgent
J2ME programming  Hi, J2ME programming - How to learn J2ME Programming very fast? Thank You
Validating XML
Validating XML  Hi, I have a string containing data in XML format. I have to Validate this xml data. Is there any method in java that allows strings as input to validate xml?   Please visit the following link: http
urgent need
urgent need   Input a line. Count the number of words that start with a capital letter
validating web pages
validating web pages  How to validate HTML web pages
Validating image size
Validating image size  How to validate image size to 2MB in javascript which is updating to mysql database
validating a form before data is entered.
validating a form before data is entered.  How can I avoid validating a form before data is entered
validating - Swing AWT
validating   hi another problem i am facing in swing is that is i have got many textfeilds ex: Roll No: Name: Address: so Roll No TextField have to Contains only Numbers. Name TextFields have to contain only
validating email id
validating email id  how to validate the email id ?   <html> <script> function validate(){ var e=document.getElementById('email').value; var regExpObj = /(\d\d\d)-\d\d\d\d\d\d\d\d/; var reg
Urgent requirement
Urgent requirement  I want to implement Autocompletion code for Jcombobox in swing can you please help me out from
Validating the password field
Validating the password field  When the validate method returns back to the registration page the password field get cleared there by asking again one more time to enter the password field at the time of re-submitting the form
MySQL default port number and how to change it
number used by the MySQL Server. This information is very important for you...MySQL default port number and how to change it What is default port number... the port number in your program. You can also change the port number of MySQL
PLease reply its urgent
PLease reply its urgent   Write a java function that has...? That takes a number of hours and minutes (up to several days), and returns the number of times the minute and hour hands of a standard analog clock would cross
validating username and password from database
validating username and password from database  Hello sir, i am developing a login page. i want that when i fill data in text fields. it validate data from database. if enter data is match from database. page goes to next page
Validating date in javascirpt - Development process
Validating date in javascirpt   Hi Friends, Can u plz give sample code for validating date in javascript using textbox.((dd--mm--yyyy format) Thank u in advance  Hi, The following code may be useful
java linked list urgent!!!
java linked list urgent!!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must

Ads