Share on Google+Share on Google+

salim
The Unix error
1 Answer(s)      4 years and 10 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; } }

Ads

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 >
What is difference between UNIX Hosting and Window Hosting?
What is difference between UNIX Hosting and Window Hosting?  Which host to select? Unix or Windows or Linux? I want more information about... to learn about these technologies. What is difference between UNIX Hosting
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
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads