I have the following code and it is not working. it will pass the info
along. hwew is a copy of the entire code:.

<?php ?>
<script>
function Validate()
{
if (document.UserAddNew.username.value == '')
{
alert('Warranty Database:\nPlease Enter a Username\!');
document.UserAddNew.username.select();
return false;

}
if (document.UserAddNew.password.value == '')
{
alert('Warranty Database:\nPlease Enter a Password\!');
document.UserAddNew.password.select();
return false;
}
}

function checkpasswords() {
df=document.forms['UserAddNew'];
if (df['password'].value==df['password2'].value) {
// Passwords matched, clear password2, allow form to submit
df['password2'].value='';
return true;
else {
alert('Passwords did not match');
return false;
}
}

</script>


<form method='post' action='' name='UserAddNew' onSubmit='return
checkpasswords()'>
Username : <INPUT TYPE='TEXT' name='username' title='username'
id='username'><br>
Password : <INPUT TYPE='TEXT' name='password' title='password'
id='password'><br>
Re Type Password: <INPUT TYPE='TEXT' name='password2' title='password2'
id='password2'><br>
Department: <SELECT name='department' title='department' id='department'>
<OPTION value='Managment'>Managment</OPTION>
<OPTION value='Sales'>Sales</OPTION>
<OPTION value='Tech Support'>Tech Support</OPTION>
<OPTION value='Returns'>Returns</OPTION>
<OPTION value='Other'>Other</OPTION></SELECT><br>
<input type=submit name=submit value='Add'>
<input type=reset name=reset value='Reset' onClick="if (confirm('Warranty
Database:\nAre you sure you want to reset the form\?'));">
</FORM>

----- Original Message ----- 
From: "Neil Smith [MVP, Digital media]" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, June 29, 2004 6:25 AM
Subject: [SPAM] RE : validate 2 password fields


> Attach onsubmit="return checkpasswords()" to your form tag.....
>
> function checkpasswords() {
>          df=document.forms["DisplayUser"];
>          if (df["password1"].value==df["password2"].value) {
> //      Passwords matched, clear password2, allow form to submit
>                  df["password2"].value="";
>                  return true;
>           else {
>                  alert("Passwords did not match");
>                  return false;
>          }
> }
>
> Cheers - Neil
>
> > >
> >Message-ID: <[EMAIL PROTECTED]>
> >From: "Vincent Jordan" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Date: Sun, 27 Jun 2004 20:49:47 -0400
> >MIME-Version: 1.0
> >Content-Type: multipart/alternative;
> >         boundary="----=_NextPart_000_0029_01C45C88.48576050"
> >Subject: 2 requests: validate 2 password fields as equal and rewrite data
> >
> >Could someone instruct me or point me in the right direction. I would
like
> >to have a <input type=password name=password> <input type=password
> >name=password2> when submit it will check to se if password and password2
> >are = ( i do not want password2 to end up in POST on submit.)
>
>
> ========================================================
> CaptionKit http://www.captionkit.com : Production tools
> for accessible subtitled internet media, transcripts
> and searchable video. Supports Real Player, Quicktime
> and Windows Media Player.
>
> VideoChat with friends online, get Freshly Toasted every
> day at http://www.fresh-toast.net : NetMeeting solutions
> for a connected world.
>
>
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to