password validation with special character

Ads

 
 
 

Share on Google+Share on Google+

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

how to validate password with special character using java script?

Ads
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
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
Protect Special Characters.
Protect Special Characters.  How To Protect Special Characters in Query String
special characters in my HTML
special characters in my HTML  How do I get special characters in my HTML
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads