password validation with special character

Ads
 

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>

Ads









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-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-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
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
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
Password
Password  make a program which ask ask the username and password * in this format. in C language
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
validation
validation  How to validate username and password in a login screen
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
validation
validation  we are doing payroll system project in java.So pls provide the complete validation code for employee master form
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
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

Ads