Home Answers Viewqa JSP-Servlet Validating Number Very Urgent

 
 


Ragavendran.R
Validating Number Very Urgent
1 Answer(s)      4 years and 10 months ago
Posted in : JSP-Servlet

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 Pages:
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
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
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
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
Urgent
J2ME programming  Hi, J2ME programming - How to learn J2ME Programming very fast? Thank You
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
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
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) - 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..  
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
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
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
urgent need
urgent need   Input a line. Count the number of words that start with a capital letter
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 Emp ID Reply - JSP-Servlet
Validating Emp ID Reply  Respected Sir/Madam, I am Ragavendran.R.. Thanks for your quick response.. Actually I need to check whether Emp ID...').value= document.getElementById('name').value='' Its Urgent plz send me
validating a HTML
validating a HTML  What are the reasons for validating a HTML
"Urgent" convert this code to GUI - Swing AWT
all the other classes. its very urgent. //CLASS CashDispenser public class..."Urgent" convert this code to GUI   please convert for me this code...() { screen.displayMessageLine("\nplease enter your \n account number:"); int accountNumber
Urgent: HttpRequest - JSP-Servlet
Urgent: HttpRequest  Hi, I want to send a http Request. Their will be another program which will receice the request process it and send back...; } } Enter First Number: Enter Second Number: 2) add.jsp Thanks
Program urgent - JSP-Servlet
Please please its very urgent.. Thanks/Regards
Program Urgent - JSP-Servlet
automatically with the selected Employee ID and Name. Its Very Urgent.. Please send me...Program Urgent  Respected Sir/Madam, I am R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside Enter Employee ID
Download.jsp Urgent - JSP-Servlet
.. Please send me the modified code ASAP as this goes very urgent in my case
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
very important - Kindly help
very important - Kindly help   I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application number
Need the program urgent veryyyyyyyyyyyyy urgent plsssssssssssssssssss follow the standard in the program
Need the program urgent very urgent please follow the standard in the program  Restaurant Order Management System (ROMS) Problem Case: Create a ROMS system, which is intended to take an order from the customer and charge
Binary search tree (insertion) urgent!!
Binary search tree (insertion) urgent!!  Create a program... Generate random values between zero and twice the number of values to add... to create a tree containing up to the number of nodes indicated by a command line
Programming Help URGENT - JSP-Servlet
R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside... URGENT... THE ABOVE REQUIREMENTS.. I WILL BE VERY MUCH GRATEFUL
Download.jsp Urgent plz - JSP-Servlet
Download.jsp Urgent plz  Respected Sir/Madam, I am R.Ragavendran.. I got your coding for download.jsp.. A lot of Thanks... inserted after every upload very successfully.. I am sending the code for your kind
random number
random number   Please How do I generate a program that gives me random integer from 115 to 250? Using java.util.random. Thank you very much!   Hi Friend, Try the following code: import java.util.*; public final
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 XML document with a DTD
Validating XML document with a DTD If an xml document is well formed i.e.... defines the required elements, optional elements, number and order of elements...;/article> </articles> Validating With the XML Parser With Internet Explorer
VoIP Number
VoIP Number VoIP Numbers With a VoIPtalk Incoming number, callers can reach you by calling a UK number no matter where you are, Simply plug... connection and anyone can reach you by dialling your individual number. The VoIPtalk
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.