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



Home Answers Viewqa JavaScriptQuestions password validation with special character

Have Programming Question? Ask it here!
 
 
 


Abinash Sahu
password validation with special character
1 Answer(s)      2 years and 9 months ago
Posted in : JavaScript Questions


how to validate password with special character using java script?


Advertisement
View Answers

July 19, 2013 at 11:04 AM


password validation with numeric ,character and special character ;
<script type="text/javascript" language="javascript">

function validation()
{

    var a=document.form.fnm.value;
    var b=document.form.mnm.value;
    var c=document.form.mnm.value;
    var d=document.form.pass.value;
    var e=document.form.cpass.value;
     if(a=="")
     {  
       alert("Plz Enter Name");

     } 
     else if(!isNaN(form.fnm.value))
     {
        alert("Plz Enter character"); 
     }
     else if(a.length<5 || a.length>20)
     {
         alert("Plz Enter  min 5 and max 20 character"); 
     }
     else if(b=="")
     {  
       alert("Plz Enter Middle Name");

     } 
     else if(!isNaN(form.mnm.value))
     {
        alert("Plz Enter character"); 
     }
     else if(b.length<5 || b.length>20)
     {
         alert("Plz Enter  min 5 and max 20 character"); 
     }
     else if(c=="")
     {  
       alert("Plz Enter Middle Name");

     } 
     else if(!isNaN(form.lnm.value))
     {
        alert("Plz Enter character"); 
     }
     else if(c.length<5 || c.length>20)
     {
         alert("Plz Enter  min 5 and max 20 character"); 
     }
     else if(!(d==e))
      {
          alert(" not match")       
      }


      else if(d)

      {
          var filter1 = /[a-zA-Z]/g;
          var filter2 = /[@$,<>#:?_*&;]/g;
          var filter3 = /[0-9]/g;
           if (d.match(filter1) && d.match(filter2) && d.match(filter1) && d.match(filter3)) {
        alert("valid");

    } 
        else
        {
            alert("invalid");
        }

      }

      else 
      {
           var email = document.getElementById('txtEmail');
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

    if (!filter.test(email.value)) {
    alert('Please provide a valid email address');
    email.focus;
    return false;         
      }
      }
}

</script>


 <form method="post" name="form" action="">
   <table align="center" border="2">
     (mendetary field *)
     <tr>
       <td>First name*</td>
       <td><input type="text" name="fnm"></td>
       </tr>
       <tr>
       <td>Middle name*</td>
    <td><input type="text" name="mnm"></td>
     </tr>
     <tr>
       <td>Last name*</td>
    <td><input type="text" name="lnm"></td>
     </tr>
     <tr>
       <td>Password*</td>
    <td><input type="password" name="pass"></td>
     </tr>
     <tr>
       <td>Confirm Password</td>
    <td><input type="password" name="cpass"></td>
     </tr>
     <tr>
       <td>Mobile No.*</td>
    <td><input type="text" name="mno"></td>
     </tr>
     <tr>
       <td>Tele Phone No.*</td>
    <td><input type="text" name="tno"></td>
     </tr>

     <tr>
       <td>Email ID*</td>
    <td><input type="text" name="email" id="txtEmail"></td>
     </tr>
     <tr>
    <td>Gender</td>
    <td><input type="radio" name="rad">MALE*


    <input type="radio" name="rad">Female* </td>
     </tr>

     <tr>
       <td>Select Country*</td>
    <td><select name="country">
    <option value=""></option>
    <option value="india">india</option>
    <option value="pakistan">pakistan</option>
    <option value="shrilanka">shrilanka</option>
    <option value="america">america</option>
    <option value="japan">japan</option>
    <option value="china">china</option>
    </select>

    </td>
     </tr>
     <tr>
       <td>Address*</td>
    <td><input type="textarea" name="txtarea"></td>
     </tr>
     <tr>
       <td>Pin Code*</td>
    <td><input type="text" name="pcode"></td>
     </tr>
     <tr>

    <td><input type="checkbox" name="chk">plz check </td>
     </tr>
     <tr>

    <td align="center" colspan="2"><input type="submit" name="btnsub" value="submit" onclick="validation()"></td>
     </tr>
   </table>
 </form> 
 <div id="fnm1" style="display:none">
 <font size="+1" color="#FF0000"> pLz enter name
 </div>


Related Tutorials/Questions & Answers:
password validation with special character
password validation with special character  how to validate password with special character using java script
javascript regex validate Special character
javascript regex validate Special character   javascript regex validate Special character   <html> <head> <title>Zip Code validation using regex</title> <script type="text/javascript">
Advertisements
Password validation
password and confirm password are same or not Validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
JavaScript password validation
JavaScript password validation We are going to discuses about JavaScript password special characters validation. In this example we have created one "... used JavaScript password validation and check for an alphabet , number
Login Password Validation iPhone / iPAD
Login Password Validation iPhone / iPAD  HOW TO WRITE A TEST CASE TO SET THE VALIDATION FOR LOGIN AND PASSWORD FIELD IN OBJECTIVE C, IOS.   @implementation LoginViewTests - (void)testPasswordFieldIsNotEmpty
jQuery password validation
jQuery password Validation : jQuery "equalTo: "#password" " is the method to validate or check password if the element is empty (text input... validation we can check that password and verify password are equal.   
default password Allow the user to see the typed alphanumeric or character before it is changed to an encrypted dot
default password Allow the user to see the typed alphanumeric or character before it is changed to an encrypted dot  Allow the user to see the typed alphanumeric or character before it is changed to an encrypted dot in xsl n
NSURL Validation
NSURL Validation  How to validate a NSURL string using special character validation
Password
Password  make a program which ask ask the username and password * in this format. in C language
validation
validation  validation
remove special characters iphone
remove special characters iphone  remove special characters iphone   Remove special characters iphone from Password NSString *outputString = [passwordString stringByReplacingOccurrencesOfString:@"%" withString
replace special characters in html
replace special characters in html  How can i replace the special characters in HTML?   Special Character in HTML HTML has a long list... it as it is. So, there it required to change those special character symbol to correct
PHP - Match Special Characters - PHP
PHP - Match Special Characters  a PHP script that match for special character before submitting it to database
validation
validation  we are doing payroll system project in java.So pls provide the complete validation code for employee master form
validation
validation  How to validate username and password in a login screen
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
;</td> </tr> <tr> <td>Password :</td> <td><form:password path="password" /><...; private String name; private String password; private String gender
validation
validation  please help me to check validation for <form> <table class="form"> <tr> <td class="col1"> <label>Sno:</label> </td> <td
Validation
; <b>Password</b> :<input type="Password
Validation
; <b>Password</b> :<input type="Password
JavaScript regex validate Character
Character   <html> <head> <title>Character validation.... \W shows the special character. test() method takes one argument and check... Character value : "+name); return true; } alert
form validation
want validation code,username minimum 8 char,password length must >6,and one capital,one small,one special character must.check password and confirm password...; <tr><td>password:</td><td><input type
regular expression for special characters
regular expression for special characters  How to find out regular expression for special characters
special characters in my HTML
special characters in my HTML  How do I get special characters in my HTML
special characters in my HTML
special characters in my HTML  How do I get special characters in my HTML
Protect Special Characters.
Protect Special Characters.  How To Protect Special Characters in Query String
Special Bean Types of WebApplicationContext
In this section, you will learn about Special Bean Types in the WebApplicationContext
How to avoid the Special characters? - JDBC
and if someone enters special character (like single quote ') in text field (ex L'orel) and submit, it gives a error. I know this is a special character conflict, but how... special character. Does anyone has any idea how it will be possible. Thanks
Form Validation
Form Validation  Java script validation for checking special characters and white spaces and give an alert.Please help me urgent Thanks in advance
Character Wrapper Class.
. There are special characters in UNICODE to achieve the RTL. Such character is the Mirroring...Character Wrapper Class.  what are Mirrored Unicode Characters?? and whats the use of "isMirrored(ch);method ??.where ch is any character argument
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
forgot password?
forgot password?  forgot password
Character Class
Character Class  Character defines the forDigit();,digit()methods..how can these b used and wht is radix point signifies here...in the arguments of these two???..pls answer a code on this with radix .. are these methods also
What is the special meaning of __sleep and __wakeup?
What is the special meaning of __sleep and __wakeup?  What?s the special meaning of _sleep and _wakeup
Username password
with the validation, so that if the username and password match it will continue... that checks whether the username and password is valid or not. If the user...("Password:"); text2 = new JPasswordField(15); SUBMIT=new JButton("SUBMIT
underscore as character
underscore as character  how can i consider _ as a character instead of wildcard character? my problem is like this i have 20 records as follows manohar 1234455 manohar 453635 manohar 345454 manohar_1234455 now when i am
Character class
Character class   Character defines the forDigit();,digit()methods..how can these b used and wht does radix point signify here.i want to knw what basically radix is??here in the arguments of these two???because i tried runnin
Escaping Special Characters in a Pattern
characters and replaces all the detected special characters by "F" character and display whole string with the "F" character place of any special... Escaping Special Characters in a Pattern   
How to change password mask field?
How to change password mask field?  I want to use '*' character in password. thanks in advanced............   password masking character in the standard password field can't be changed
password check
password check  how to check sighup passowrd and login password
problems in parsing the xml with the special characters
problems in parsing the xml with the special characters  Hi, I have a problem, in while parsing the xml with special characters apstrophe('). I am... to unescape the character ('). below is the sample one: private String escape
change password
change password  how to change password in the login form.... by giving options to user like this old password, new password.. pls help
Reset Password
Reset Password  coding for reset password
retype password
retype password  coding for retype password
Advertisements
 

 

 

DMCA.com