Click here to Skip to main content
15,890,512 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Insert Image in to MySql database Pin
Dennis E White25-Aug-14 4:05
professionalDennis E White25-Aug-14 4:05 
SuggestionRe: Insert Image in to MySql database Pin
Siben Nayak29-Aug-14 5:49
professionalSiben Nayak29-Aug-14 5:49 
GeneralRe: Insert Image in to MySql database Pin
Sunasara Imdadhusen3-Sep-14 21:10
professionalSunasara Imdadhusen3-Sep-14 21:10 
QuestioncreateElement, custom style, turn off webkit Appearance Pin
jkirkerx24-Aug-14 10:13
professionaljkirkerx24-Aug-14 10:13 
GeneralRe: createElement, custom style, turn off webkit Appearance Pin
Sunasara Imdadhusen3-Sep-14 21:11
professionalSunasara Imdadhusen3-Sep-14 21:11 
GeneralRe: createElement, custom style, turn off webkit Appearance Pin
jkirkerx4-Sep-14 6:13
professionaljkirkerx4-Sep-14 6:13 
AnswerRe: createElement, custom style, turn off webkit Appearance Pin
Sunasara Imdadhusen3-Sep-14 21:13
professionalSunasara Imdadhusen3-Sep-14 21:13 
QuestionPassword Validation Pin
jclito21-Aug-14 10:45
jclito21-Aug-14 10:45 
Hi,
I'd like help to complete this script I'm working on. so for it works but I'm strugling to incorporate theremaining three conditions:
1-The same character may not appear more than twice in a row (Kabooom1)
2-Not more than two sequencial alphanumeric characters are permited (Ab123cym)
3-Black list some words like:(Mark, London)

Any help would be appreciated.script as below
=========================================


XML
<script type="text/javascript">

  function checkForm(form)

  {

    if(form.username.value == "") {

      alert("Error: Username cannot be blank!");

      form.username.focus();

      return false;

    }

    re = /^\w+$/;

    if(!re.test(form.username.value)) {

      alert("Error: Username must contain only letters, numbers and underscores!");

      form.username.focus();

      return false;

    }


   re = /.{8}/;

if(form.pwd1.value != "" && form.pwd1.value == form.pwd2.value)

      if(!re.test(form.pwd1.value)) {

        alert("Error: Password must contain eight characters Only, Try again!");

        form.pwd1.focus();

        return false;

      }


    if(form.pwd1.value !== "" && form.pwd1.value == form.pwd2.value) {

      if(form.pwd1.value.length >= 9) {

        alert("Error: Password must contain eight characters Only, Try again!");

        form.pwd1.focus();

        return false;

      }



      if(form.pwd1.value == form.username.value) {

        alert("Error: Password must be different from Username!");

        form.pwd1.focus();

        return false;

      }



      re = /[0-9]/;

      if(!re.test(form.pwd1.value)) {

        alert("Error: password must contain at least one number (0-9)!");

        form.pwd1.focus();

        return false;

      }

      re = /[a-z]/;

      if(!re.test(form.pwd1.value)) {

        alert("Error: password must contain at least one lowercase letter (a-z)!");

        form.pwd1.focus();

        return false;

      }

      re = /[A-Z]/;

      if(!re.test(form.pwd1.value)) {

        alert("Error: password must contain at least one uppercase letter (A-Z)!");

        form.pwd1.focus();

        return false;

      }

    } else {

      alert("Error: Please check that you've entered and confirmed your password!");

      form.pwd1.focus();

      return false;

    }

    alert("You entered a valid password: " + form.pwd1.value);

    return true;

  }

</script>

  <h1 align="center"> Password Validation</h1>

<form ... onsubmit="return checkForm(this);">

<table align="center">

<p>Username: &nbsp&nbsp&nbsp&nbsp<input type="text" name="username"size="30"></p>

<p>Password: &nbsp&nbsp&nbsp&nbsp<input type="password" name="pwd1"size="30"></p>

<p>Confirm Password: &nbsp&nbsp&nbsp<input type="password" name="pwd2"></p>

<p><input type="submit"></p>

</form>

=================================
AnswerRe: Password Validation Pin
Richard Deeming22-Aug-14 2:40
mveRichard Deeming22-Aug-14 2:40 
AnswerRe: Password Validation Pin
ZurdoDev22-Aug-14 9:15
professionalZurdoDev22-Aug-14 9:15 
QuestionAccess Device API using Javascript Pin
Gouranga Das21-Aug-14 8:00
Gouranga Das21-Aug-14 8:00 
AnswerRe: Access Device API using Javascript Pin
Richard MacCutchan21-Aug-14 21:59
mveRichard MacCutchan21-Aug-14 21:59 
AnswerRe: Access Device API using Javascript Pin
Dennis E White22-Aug-14 4:47
professionalDennis E White22-Aug-14 4:47 
AnswerRe: Access Device API using Javascript Pin
Dennis E White22-Aug-14 5:14
professionalDennis E White22-Aug-14 5:14 
QuestionAccess Device API using Javascript Pin
Gouranga Das21-Aug-14 7:59
Gouranga Das21-Aug-14 7:59 
AnswerRe: Access Device API using Javascript Pin
ZurdoDev22-Aug-14 9:16
professionalZurdoDev22-Aug-14 9:16 
Questionscrape a table from web Pin
Mahmoud198716-Aug-14 2:58
Mahmoud198716-Aug-14 2:58 
AnswerRe: scrape a table from web Pin
borchef28-Aug-14 21:08
borchef28-Aug-14 21:08 
QuestionHow to validate postdate? Pin
loga_mca13-Aug-14 21:14
professionalloga_mca13-Aug-14 21:14 
SuggestionRe: How to validate postdate? Pin
Kornfeld Eliyahu Peter13-Aug-14 23:17
professionalKornfeld Eliyahu Peter13-Aug-14 23:17 
AnswerRe: How to validate postdate? Pin
Tushar Guru8-Sep-14 21:57
Tushar Guru8-Sep-14 21:57 
AnswerRe: How to validate postdate? Pin
Sibeesh KV24-Sep-14 0:56
professionalSibeesh KV24-Sep-14 0:56 
QuestionCollapsible gridview using javascript Pin
Member 1097302613-Aug-14 9:35
Member 1097302613-Aug-14 9:35 
AnswerRe: Collapsible gridview using javascript Pin
Anurag Gandhi22-Aug-14 8:56
professionalAnurag Gandhi22-Aug-14 8:56 
QuestionForum software.. Pin
Fever42012-Aug-14 5:50
Fever42012-Aug-14 5:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.