Hi
can't get this script to work at all. can anyone spare a moment?
this is the script, in the head of register.cfm
<script language="javascript">
function CheckValues() {
if (document.register.password1.value !=
document.register.password2.value) {
alert("The values for \'password\' and \'confirm pasword\' are different.
Please make sure both fields are the same.");
return false;
} else {
return true;
}
}
</script>
this is the call, in an include called by that page (includes/registration.cfm)
<tr>
<td align="right"><b>confirm password</b> <sup><font
color="red"><b>*</b></font></sup></td>
<cfif IsDefined("session.loggedin") AND session.loggedin IS 'yes'>
<td>
<input type="password" name="password2" size="15"
value="<cfoutput>#getuser.password#</cfoutput>" onBlur="CheckValues();">
<cfelse>
<td>
<input type="password" name="password2" size="15" onBlur="CheckValues();">
</cfif>
</td>
</tr>
I ge a js error 'object expected' when I click off the password2 field...
and while I'm at it, if the alert comes up I'd like to pull focus to the password2
field and clear it's value, something like:
<script language="javascript">
function CheckValues() {
if (document.register.password1.value !=
document.register.password2.value) {
alert("The values for \'password\' and \'confirm pasword\' are different.
Please make sure both fields are the same.");
return false;
document.register.password2.focus;
document.register.password2.value = '';
} else {
return true;
}
}
</script>
if you want to test it, go to http://test.artsoutheast.co.uk
choose 'register now'
choose a town from the drop-down
and you'll get the form I'm wibbling about ;-)
any help appreciared.
TIA
Ian W
Ian Westbrook,
FutureDream Media Limited,
(W): www.futuredream.net
(E): [EMAIL PROTECTED]
(T): +44 (0) 1303 258 985
(M): 07939 510 812
This message may contain information which is legally privileged and/or confidential.
If you are not the intended recipient, you are hereby notified that any unauthorised
disclosure, copying, distribution or use of this information is strictly prohibited.
Such notification notwithstanding any comments, opinions, information or conclusions
expressed in this message are those of the originator, not of FutureDream Media Ltd,
unless otherwise explicitly and independently indicated by an authorised
representative of FutureDream Media Ltd.