password validation with special character

password validation with special character

how to validate password with special character using java script?

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
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
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
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
ModuleNotFoundError: No module named 'django-advanced-password-validation'
ModuleNotFoundError: No module named 'django-advanced-password-validation' ...: ModuleNotFoundError: No module named 'django-advanced-password-validation' How to remove... to install padas library. You can install django-advanced-password-validation
ModuleNotFoundError: No module named 'django-password-validation'
ModuleNotFoundError: No module named 'django-password-validation'  Hi...: No module named 'django-password-validation' How to remove the ModuleNotFoundError: No module named 'django-password-validation' error? Thanks
ModuleNotFoundError: No module named 'django-password-validation-backport'
ModuleNotFoundError: No module named 'django-password-validation-backport' ...: ModuleNotFoundError: No module named 'django-password-validation-backport' How to remove the ModuleNotFoundError: No module named 'django-password-validation
ModuleNotFoundError: No module named 'django-advanced-password-validation'
ModuleNotFoundError: No module named 'django-advanced-password-validation' ...: ModuleNotFoundError: No module named 'django-advanced-password-validation' How to remove... to install padas library. You can install django-advanced-password-validation
ModuleNotFoundError: No module named 'django-password-validation'
ModuleNotFoundError: No module named 'django-password-validation'  Hi...: No module named 'django-password-validation' How to remove the ModuleNotFoundError: No module named 'django-password-validation' error? Thanks
ModuleNotFoundError: No module named 'django-password-validation-backport'
ModuleNotFoundError: No module named 'django-password-validation-backport' ...: ModuleNotFoundError: No module named 'django-password-validation-backport' How to remove the ModuleNotFoundError: No module named 'django-password-validation
ModuleNotFoundError: No module named 'fast-password-validation'
ModuleNotFoundError: No module named 'fast-password-validation'  Hi...: No module named 'fast-password-validation' How to remove the ModuleNotFoundError: No module named 'fast-password-validation' error? Thanks  
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
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.   
NSURL Validation
NSURL Validation  How to validate a NSURL string using special character validation
remove special characters iphone
remove special characters iphone  remove special characters iphone   Remove special characters iphone from Password NSString *outputString = [passwordString stringByReplacingOccurrencesOfString:@"%" withString
PHP - Match Special Characters - PHP
PHP - Match Special Characters  a PHP script that match for special character before submitting it to database
Password
Password  make a program which ask ask the username and password * in this format. in C language
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
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
validation
validation  validation
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
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
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
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
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
regular expression for special characters
regular expression for special characters  How to find out regular expression for special characters
validation
validation  How to validate username and password in a login screen
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
Special Bean Types of WebApplicationContext
In this section, you will learn about Special Bean Types in the WebApplicationContext
validation
validation  we are doing payroll system project in java.So pls provide the complete validation code for employee master form
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
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
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
JavaScript regex validate Character
Character.   <html> <head> <title>Character validation... Character value : "+name); return true; } alert("It is not valid character !"); return false; } </script> <
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
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
forgot password?
forgot password?  forgot password
How to convert entity character to html character
How to convert entity character to html character  How to convert entity character to html character
validation
;</td> </tr> <tr> <td>Password :</td> <td><form:password path="password" /><...; private String name; private String password; private String gender
Validation
); JLabel label=new JLabel("JTable validation Example",JLabel.CENTER); JPanel panel=new JPanel(); panel.add(scroll); JFrame frame=new JFrame("JTable validation
Validation
; <b>Password</b> :<input type="Password
Validation
; <b>Password</b> :<input type="Password

Ads