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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


salim
The Unix error
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners


var a=document.check.username.value; if(a=="" ) { alert("Enter a valid UserName"); return false; } if(!isNaN(a) ) { alert("Enter a valid UserName"); return false; } var b=document.check.password.value; if(b=="") { { alert("Enter password"); return false; } }


Advertisement
View Answers

May 28, 2012 at 12:59 PM


The given code allow the user to enter username and password.It will show an error message if user leave the fields blank.

<script>
function validate(){
var a=document.form.username.value; 
if(a=="" ) {
alert("Enter a valid UserName");
return false; 
}
if(!isNaN(a) ) 
{
alert("Enter a valid UserName");
return false;
}
var b=document.form.password.value;
if(b=="") {
{

alert("Enter password"); 
return false; 
} 
}
}
</script>
<form name="form" method="post"  action="" onsubmit="return validate();">
  <table>
  <tr>
    <td>Username:</td>
    <td><input type="text" name="username"></td>
  </tr>
  <tr>
    <td>Password:</td>
    <td><input type="password" name="password"></td>
  </tr>
  <tr>
  <tr>
  <td></td>
  <td>
  <input type="submit" value="Submit" name="addproduct"/>
  </td>
  </tr>
</table> 
</form>


Related Tutorials/Questions & Answers:
The Unix error
The Unix error  var a=document.check.username.value; if(a=="" ) { alert("Enter a valid UserName"); return false... will show an error message if user leave the fields blank. <script> function
unix
unix  not able to download java into unix os
Advertisements
unix
unix  hai friends, I am new to to java with unix.can you any one tell me ho to work unix in windows xp.i search in net,it will show the aludra.usc.edu.how can i install this? thanks
unix/ubuntu os
unix/ubuntu os  how to find jdk path in unix through terminal any command
unix programming - Development process
unix programming  write a c program that stimulates 'ls" command
unix program - UML
unix program  sorry there is no unix category i slected uml 1.write a c shell script on links? 2.write a c shell that stimulates the fork? 3.write a c shell that stimulates the umask? 4.write a c shell that stimulates
UNIX - Java Beginners
UNIX  Dear Sir, Kindly send some important points/notes in UNIX since I have taken the exam pertains to UNIX, so that it will be very helpful..., Unix: The UNIX operating system was developed at AT&T Bell Laboratories
JBoss Unix and Line Separator
JBoss Unix and Line Separator  Hi, I am trying to solve an critical problem. I have an application which write a batch file using the method println... separator from O.S. \n on unix, but I am trying to change to \r\n. I change
Connecting to Unix through Java - JavaMail
Connecting to Unix through Java  Could you please tell a sample code, where i connect to the unix server and run a script and write the results in a file and mail that file back to me
Unix Web Hosting
Unix Web Hosting Unix Web Hosting is the type hosting provided on the Unix Servers. Unix Web Hosting is very reliable hosting option. Unix Hosting.... UNIX web hosting and Linux web hosting are the most powerful and reliable hosting
Where i can use UNIX Operating System?
Where i can use UNIX Operating System?  Where i can use UNIX Operating System
Java code to run unix command - Java Beginners
Java code to run unix command  Hi, I need a java code to connect to a remote unix server and run a unix command. Please help. Regards, Pratyush
Unix and Perl Programmer
Unix and Perl Programmer       Position Vacant: Unix and Perl Programmer  Job Description  We are looking for Perl Programmers with Unix experience
in unix which command is used to create files
in unix which command is used to create files  in unix which command is used to create files   The cat command in UNIX can be used to create and display information from a file. Command to create a file % cat >
in unix which command is used to sort the lines of data in a file in reverse order
in unix which command is used to sort the lines of data in a file in reverse order  in unix which command is used to sort the lines of data in a file in reverse order   " sort -r " command in unix is used to sort
the commonly used unix commands like date ls cat etc. are stored in
the commonly used unix commands like date ls cat etc. are stored in  the commonly used unix commands like date ls cat etc. are stored
error
error  while iam compiling iam getting expected error
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
Error
Error  I have created ajax with php for state and city. When I change state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower
error
error
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version. This type error also comes when java file
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during deployment: Exception while deploying the app [HelloWorld
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
 

 

 

DMCA.com