jsp validation

jsp validation

enter name-___ enter number-__

I want that the focus should not go to number till the time u have entered name. Means the number text should be disabled.. i require code for it....

View Answers

April 11, 2011 at 1:17 PM

<html>
<script>
function validate(){
var nn=document.form.name.value;
var num=document.form.number.value;
if(nn==""){
  alert("Enter Name");
  document.form.name.focus();
  return false;
}
else{
  document.form.number.focus();
  document.form.number.disabled=false;
if(num==""){
   alert("Enter Number");
   return false;
}
}
return true;
}
</script>
<form name="form" onsubmit="javascript:return validate();">
<table>
<tr><td>Enter Name:</td><td><input type="text" name="name"></td></tr>
<tr><td>Enter Number:</td><td><input type="text" disabled name="number"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

Ads









Related Tutorials/Questions & Answers:
jsp validation
jsp validation  enter name-___ enter number-__ I want that the focus should not go to number till the time u have entered name. Means the number text should be disabled.. i require code
jsp+ajax validation
jsp+ajax validation  hi, I have created the jsp form (course... have created student jsp form where it should display register number... 60% in the drop down list .how to validate student from using ajax and jsp
Advertisements
JSP data base validation
JSP data base validation  please explain how to validate form input string with database n also how its notify that entered data exists already .please reply soon   hi friend, <%@ page language="java" contentType
validation before entering values into database in jsp
validation before entering values into database in jsp  Hi, my project involves entering data into database from jsp form.but before entering into database it should pop up a alert message that "you have selected product:name
Date validation in JSP
Date validation in JSP       Example for validating date in a specified format in a JSP page This example illustrates how to use date validation in a JSP page. Here in this code we are using
validation
validation  validation
Ajax validation - JSP-Servlet
validation
validation  we are doing payroll system project in java.So pls provide the complete validation code for employee master form
validation.....
validation.....  hi.......... thanks for ur reply for validation code. but i want a very simple code in java swings where user is allowed to enter only numerical values in textbox , if he enters string values then it should
validation
Validation method valid the in put. otherwise call the javascript onsubmit to check... code.Ok if you use struts then you can use Validation method valid the in put
Validation
); JLabel label=new JLabel("JTable validation Example",JLabel.CENTER); JPanel panel=new JPanel(); panel.add(scroll); JFrame frame=new JFrame("JTable validation
validation
form using spring ,hibernate and jsp my all classes and jsp pages are pasted..." prefix="form"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix
validation
validation  please help me to check validation for <form> <table class="form"> <tr> <td class="col1"> <label>Sno:</label> </td> <td
JSP
JSP   How to create CAPTCHA creation by using JSP? I need an code for CAPTCHA creation by using JSP...   You can create a captcha validation using jsp. Have a look at the following tutorial: Captcha Creation
Email validation is JSP using JavaScript
Email validation is JSP using JavaScript... will show you how to validate email address in you JSP program using JavaScript.... In your JSP program you can use JavaScript to validate the email address
Validation of datepicker
Validation of datepicker  I have a datepicker in my JSp...the seleted dates are put in a text box. I want the alert the user from selecting future... a future date is entered..How to do this validation in javascript or jsp
JSP Alert
;     JSP Alert is used to put the validation on login... the validation on the login form using Javascript method in JSP page.  Understand... in a JSP page. Before applying validation we create a JSP file "
JSP
; 2nd page is for server side validation of registration page Now, I want...; Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/javascriptpagerefresh.shtml http://www.roseindia.net/jsp/user-registration-form
jsp.....
jsp.....  1..login screen->user-id and password will be entered and save has to be validated against database corresponding table.on successful validation,detail like client ip and type of browser has to captured
Struts validation
Struts validation  I want to put validation rules on my project.But... validation rules,put the plugins inside strutsconfig.xml, put the html:errors tag in jsp,and also mention all the messages in the applicationresources.properties.
jsp
jsp  how jsp translated into servlets
JSP
JSP  How to run jsp program in eclipse
jsp
jsp  how to create jsp page
Jsp
Jsp  Can I implement interface in jsp
JSP
what is JSP forward tag for  what is JSP forward tag for   It forwards the current request to another JSP page. Below is the syntax for the same:- <jsp:forward page="...url..." /> We can also forward parameter
jsp
jsp  how to include two jsp page
jsp
jsp  how to create a table in oracle using jsp and the table name is entered in text feild of jsp page
jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input
JSP
JSP  Hi, What is JSP? What is the use of JSP? Thanks   Hi, JSP Stands for Java Server Pages. It is Java technology for developing web applications. JSP is very easy to learn and it allows the developers to use Java
jsp
jsp  how to connect the database with jsp using mysql   Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/connectjspwith_mysql.shtml http://www.roseindia.net/jsp/Accessingdatabase-fromJSP.shtml
jsp
jsp   what is the basic necessities reguired for running jsp using JDBC bridge?? and how to write a jsp code to access the detail present in microsoft access pls send link regarding above

Ads