close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Password confirmation field

Thread began 7/25/2011 12:43 pm by iainmacdonald331081 | Last modified 8/31/2011 3:30 pm by iainmacdonald331081 | 5043 views | 10 replies |

iainmacdonald331081

Password confirmation field

I've got a registration page here:

registration/

which is pretty much working, except for the password confirmation field. The validation error only displays if the field is empty, but not if the field contains different text to the password field.

Any idea what I'm missing here?

Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

You should be adding the confirm field with:

Insert->Spry->Spry Validation Confirm

It looks like you just added a regular spry validation field and not a confirm.

Sign in to reply to this post
Did this help? Tips are appreciated...

iainmacdonald331081

Thanks Ray - I didn't add anything - the Confirm field was added as part of the Security Assist wizard.

The code currently looks like:

<div class="errorGroup"> 
<span id="Registration_group_1_Confirm_Spry">
<input id="Registration_group_1_Confirm" name="Registration_group_1_Confirm" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("registration","Registration_group_1_Confirm"):"")); ?>" size="50" tabindex="13" onBlur="hideServerError('Registration_group_1_Confirm_ServerError');">
<?php
if (ValidatedField('registration','registration')) {
if ((strpos((",".ValidatedField("registration","registration").","), "," . "8" . ",") !== false || "8" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="Registration_group_1_Confirm_ServerError">Password values must match.</span>
<?php //WAFV_Conditional registration.php registration(8:)
}
}
}?>
<span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Password values must match.</span> </span>
</div>



So that has a <span id> value of Registration_group_1_Confirm_Spry - which looks right.

Or, if I take it out, and add a new field myself:

<span id="spryconfirm2">
<label for="Confirm">Confirm</label>
<input type="text" name="Confirm" id="Confirm" />
<span class="confirmRequiredMsg">A value is required.</span><span class="confirmInvalidMsg">The values don't match.</span></span>

How do I relate that back to the Password field?

Sign in to reply to this post

Ray BorduinWebAssist

This line should be updated:

var Registration_group_1_Confirm_Spry = new Spry.Widget.ValidationTextField("Registration_group_1_Confirm_Spry", "none", { isConfirm:true , validateOn:["blur"]});


to:

var Registration_group_1_Confirm_Spry = new Spry.Widget.ValidationConfirm("Registration_group_1_Confirm_Spry", "Registration_group_1_password");


And then you'll have to add the spry confirm .js and .css files to your header. I've attached a copy of those files.

Attached Files
SpryValidationConfirm.zip
Sign in to reply to this post
Did this help? Tips are appreciated...

iainmacdonald331081

Thanks Ray - added and amended that, and now getting the error:

Spry.ValidationConfirm ERR: The element Registration_group_ 1_Confirm_Spry doesn't exist

Sign in to reply to this post

Ray BorduinWebAssist

It has an extra space added by the forum since I didn't add the code in a code block.

Remove the space before the 1 in "group_ 1"

I'll update my example code.

Sign in to reply to this post
Did this help? Tips are appreciated...

iainmacdonald331081

Sorry - might have spotted that one...

That field isn't doing anything validation wise now though....

registration/

I tried:

var Registration_group_1_Confirm_Spry = new Spry.Widget.ValidationConfirm("Registration_group_1_Confirm_Spry", "Registration_group_1_password",{validateOn:["blur"]});



But that didn't work either.

Sign in to reply to this post

Ray BorduinWebAssist

Yeah I forgot a step.... you do need to add , {validateOn:["blur"]} like you have... but you also have to update the validated field span tags from:

<span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Password values must match.</span>

to:

<span class="confirmRequiredMsg">Please enter a value</span><span class="confirmInvalidMsg">Password values must match.</span>

Sign in to reply to this post
Did this help? Tips are appreciated...

iainmacdonald331081

Thanks Ray - that's that one all working now.

Sign in to reply to this post

Ray BorduinWebAssist

What version of Dreamweaver are you using? This could be an issue with needing to install the latest spry validation into your DW.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...