Click here to Skip to main content
15,911,711 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: not a member Pin
Viper82521-Mar-07 23:27
Viper82521-Mar-07 23:27 
GeneralRe: not a member Pin
Laxman Auti22-Mar-07 6:41
Laxman Auti22-Mar-07 6:41 
AnswerRe: not a member Pin
chat_sp2001@yahoo.com22-Mar-07 0:00
chat_sp2001@yahoo.com22-Mar-07 0:00 
GeneralRe: Pin
Viper82522-Mar-07 0:32
Viper82522-Mar-07 0:32 
Questionasp.net errors Pin
saravanan0521-Mar-07 3:36
saravanan0521-Mar-07 3:36 
AnswerRe: asp.net errors Pin
Laxman Auti21-Mar-07 4:56
Laxman Auti21-Mar-07 4:56 
QuestionNeed javascript Pin
Imran Khan Pathan21-Mar-07 3:32
Imran Khan Pathan21-Mar-07 3:32 
AnswerRe: Need javascript Pin
Laxman Auti21-Mar-07 4:53
Laxman Auti21-Mar-07 4:53 
Imran Khan Pathan wrote:
I need javascript for password field for checking minimum 6 char and maximum 20 char.

<SCRIPT LANGUAGE="JavaScript">
function validatePwd() {
var invalid = " "; // Invalid character is a space
var minLength = 6; // Minimum length
var pw1 = document.myForm.password.value;
var pw2 = document.myForm.password2.value;
// check for a value in both fields.
if (pw1 == '' || pw2 == '') {
alert('Please enter your password twice.');
return false;
}
// check for minimum length
if (document.myForm.password.value.length < minLength) {
alert('Your password must be at least ' + minLength + ' characters long. Try again.');
return false;
}
// check for spaces
if (document.myForm.password.value.indexOf(invalid) > -1) {
alert("Sorry, spaces are not allowed.");
return false;
}
else {
if (pw1 != pw2) {
alert ("You did not enter the same new password twice. Please re-enter your password.");
return false;
}
else {
alert('Nice job.');
return true;
      }
   }
}
</script>

HTML code
<form name=myForm onSubmit="return validatePwd()">
Enter your password twice.
<br>
(At least 6 characters, 20 characters max, and spaces are not allowed.)
<p>
Password: <input type=password name=password maxlength=20>
<br>
Verify password: <input type=password name=password2 maxlength=20>
<p>
<input type=submit value="Submit">
</form>
</center>



Knock out 't' from can't,
You can if you think you can
Cool | :cool:

QuestionDrop Down list Pin
Kushi Bobby21-Mar-07 3:31
Kushi Bobby21-Mar-07 3:31 
QuestionRe: Drop Down list Pin
Laxman Auti21-Mar-07 4:39
Laxman Auti21-Mar-07 4:39 
AnswerRe: Drop Down list Pin
Kushi Bobby21-Mar-07 20:13
Kushi Bobby21-Mar-07 20:13 
GeneralRe: Drop Down list Pin
Laxman Auti21-Mar-07 20:49
Laxman Auti21-Mar-07 20:49 
QuestionResizing Report Viewer Pin
kiran0121-Mar-07 2:07
kiran0121-Mar-07 2:07 
QuestionResricting resource utilization to 30% Pin
vijayaBTS21-Mar-07 1:40
vijayaBTS21-Mar-07 1:40 
AnswerRe: Resricting resource utilization to 30% Pin
N a v a n e e t h21-Mar-07 2:27
N a v a n e e t h21-Mar-07 2:27 
GeneralRe: Resricting resource utilization to 30% Pin
vijayaBTS21-Mar-07 2:35
vijayaBTS21-Mar-07 2:35 
QuestionImprove the performance Pin
vijayaBTS21-Mar-07 1:36
vijayaBTS21-Mar-07 1:36 
AnswerRe: Improve the performance Pin
ca8msm21-Mar-07 1:48
ca8msm21-Mar-07 1:48 
GeneralRe: Improve the performance Pin
N a v a n e e t h21-Mar-07 2:26
N a v a n e e t h21-Mar-07 2:26 
AnswerRe: Improve the performance Pin
DavidNohejl21-Mar-07 1:51
DavidNohejl21-Mar-07 1:51 
GeneralRe: Improve the performance Pin
vijayaBTS21-Mar-07 2:38
vijayaBTS21-Mar-07 2:38 
JokeHeight of technical overseas !!!!! Pin
Sun Rays21-Mar-07 1:32
Sun Rays21-Mar-07 1:32 
GeneralRe: Height of technical overseas !!!!! Pin
badgrs21-Mar-07 2:10
badgrs21-Mar-07 2:10 
GeneralRe: Height of technical overseas !!!!! Pin
M A A Mehedi Hasan21-Mar-07 2:43
M A A Mehedi Hasan21-Mar-07 2:43 
JokeRe: Height of technical overseas !!!!! Pin
Laxman Auti21-Mar-07 5:10
Laxman Auti21-Mar-07 5:10 

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.