close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

cannot EDIT validation without causing error

Thread began 7/21/2010 10:36 am by sam308940 | Last modified 7/30/2010 8:31 pm by Dani Chankhour | 932 views | 8 replies |

sam308940

cannot EDIT validation without causing error

So I have some validation on a page. specifically the checkout page in ecart.

so its working fine.
but i have 1 field that is a select menu and I want to add that as a required item.

when i go to the validation tool to edit, I get 2 kinds of errors.
1. if i go to edit and dont add any new validation, then when i hit finish - it rewrites the code except refers to every validation rule to one field. (it changes them all to the email field).

i also tried editing and adding the new field to the validation and i get the same error. I just tested it without adding new validation to see if it was the new rule or not.



2. I created a test page with a select field on it and added validation. worked fine. so i copied that code over to my current working checkout page (current unedited validation works). adding the 1 line of code caused the form to not validate at all. and I did put it in the correct place. Unless there is a sequences where selects has to go for validation.


ANY HELP!? DO YOU SEE MY ERROR? WHAT AM I DOING WRONG?!

HERES THE LINE I ADDED (just before the alert errors code)
WAValidateRQ(document.forms[0].order_hear,'- Agree to terms is required',document.forms[0].order_hear,0,true,'select');


HERES THE CURRENT VALIDATION CODE FROM THE ON SUBMIT
onsubmit="WAValidateCC(document.forms[0].cc_number,document.forms[0].cc_number.value,'- Invalid credit card number','','4:51:52:53:54:55:34:37:',document.forms[0].cc_number,0,true);WAValidateEL(document.forms[0].cc_number,document.forms[0].cc_number.value,'- Invalid number of characters in Card Number',12,20,'',document.forms[0].cc_number,0,true);WAValidateNM(document.forms[0].cvv,'- Invalid Security Code.',0,9999,0,'','',',.',document.forms[0].cvv,0,true);WAValidateEL(document.forms[0].cvv,document.forms[0].cvv.value,'- Invalid number of characters in Security Code',3,4,'',document.forms[0].cvv,0,true);WAValidateEM(document.forms[0].email,document.forms[0].email.value,'- Invalid Email Address',document.forms[0].email,0,true);WAValidateEL(document.forms[0].firstname,document.forms[0].firstname.value,'- Invalid First name',2,50,'',document.forms[0].firstname,0,true);WAValidateEL(document.forms[0].lastname,document.forms[0].lastname.value,'- Invalid Last name',2,50,'',document.forms[0].lastname,0,true);WAValidateEL(document.forms[0].phone,document.forms[0].phone.value,'- Invalid Phone Number',2,50,'',document.forms[0].phone,0,true);WAValidateEL(document.forms[0].street1,document.forms[0].street1.value,'- Invalid Street Address',2,100,'',document.forms[0].street1,0,true);WAValidateEL(document.forms[0].city,document.forms[0].city.value,'- Invalid City',2,100,'',document.forms[0].city,0,true);WAValidateEL(document.forms[0].postcode,document.forms[0].postcode.value,'- Invalid Zip/Postal Code',2,20,'',document.forms[0].postcode,0,true);WAValidateEL(document.forms[0].shipping_firstname,document.forms[0].shipping_firstname.value,'- Invalid Shipping Information, First name',2,100,'',document.forms[0].shipping_firstname,0,true);WAValidateEL(document.forms[0].shipping_lastname,document.forms[0].shipping_lastname.value,'- Invalid Shipping Information, Last name',2,100,'',document.forms[0].shipping_lastname,0,true);WAValidateEL(document.forms[0].shipping_phone,document.forms[0].shipping_phone.value,'- Invalid Shipping Information, Phone',2,100,'',document.forms[0].shipping_phone,0,true);WAValidateEL(document.forms[0].shipping_street1,document.forms[0].shipping_street1.value,'- Invalid Shipping Information, Street Address',2,100,'',document.forms[0].shipping_street1,0,true);WAValidateEL(document.forms[0].shipping_city,document.forms[0].shipping_city.value,'- Invalid Shipping Information, City',2,100,'',document.forms[0].shipping_city,0,true);WAValidateEL(document.forms[0].shipping_postcode,document.forms[0].shipping_postcode.value,'- Invalid Shipping Information, Zip/Postal Code',2,20,'',document.forms[0].shipping_postcode,0,true);WAValidateRQ(document.forms[0].order_terms,'- Agree to terms is required',document.forms[0].order_terms,0,true,'checkbox');WAAlertErrors('The following errors were found:','',true,false,false);return document.MM_returnValue"

Sign in to reply to this post

Dani Chankhour

Could you please send me your check out page to do some more testing so i can see what is causing the issue. It seems that you should be able to add validation to any new fields even if you have already applied validation.

Sign in to reply to this post

sam308940

Thanks for taking a look at this.
Im attaching the page.

Sam

Attached Files
cart_checkout.zip
Sign in to reply to this post

sam308940

Dani

There is a 2nd thing I would like to do (if we can solve the first!)
I have another field call order_hearp that i would like required, IF AND ONLY IF the selection made on order_hear = "Photographer".

If you know how I can accomplish this I would appreciate the help.

Sign in to reply to this post

Dani Chankhour

I did a test with your page and i was add validation to the select list with no issue. here is the steps i took:

1. Click on the <Form tag in code view our select the select list in design view.
2. open the Behaviors Panel (Window -> Behaviors) and click the + button
3. i selected WA Validation Toolkit -> Apply Client Validations -> Required...
4. select the field you want to validate and click ok

You from should be updated with the new validation added. (i have attached an update file).

for your second question, it looks like you would want to use Conditional Validation. You can get to that from the Behaviors panel -> WA Validation Toolkit -> Conditional Validation.

Attached Files
cart_checkout.php.zip
Sign in to reply to this post

sam308940

Well I tried your instructions EXACTLY. I still get the issue where it overrides every validation to the EMAIL. This is what i get in the form tag when I add it
see how it says ('ecart_checkout_form').email for every validation rule?

<form action="cart_confirm.php" method="post" name="ecart_checkout_form" id="ecart_checkout_form" onsubmit="WAValidateCC(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid credit card number','','4:51:52:53:54:55:34:37:',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid number of characters in Card Number',12,20,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateNM(document.getElementById('ecart_checkout_form').email,'- Invalid Security Code.',0,9999,0,'','',',.',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid number of characters in Security Code',3,4,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEM(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Email Address',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid First name',2,50,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Last name',2,50,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Phone Number',2,50,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Street Address',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid City',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Zip/Postal Code',2,20,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Shipping Information, First name',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Shipping Information, Last name',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Shipping Information, Phone',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Shipping Information, Street Address',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Shipping Information, City',2,100,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateEL(document.getElementById('ecart_checkout_form').email,document.getElementById('ecart_checkout_form').email.value,'- Invalid Shipping Information, Zip/Postal Code',2,20,'',document.getElementById('ecart_checkout_form').email,0,true);WAValidateRQ(document.ecart_checkout_form.email,'- Agree to terms is required',document.ecart_checkout_form.email,0,true,'text');WAValidateRQ(document.ecart_checkout_form.order_hear,'- How did you find us is required',document.ecart_checkout_form.order_hear,0,true,'select');WAValidateRQ(document.ecart_checkout_form.order_hear,'- How did you find us is required',document.ecart_checkout_form.order_hear,0,false,'select')">

Sign in to reply to this post

sam308940

OK - I downloaded and updated the latest version of validation toolkit.
So now - I dont get the error when edit/adding validation.

HOWEVER

I still get the error on the page itself - the same as I described when I was handcoding the additional validation. The additional validation line renders the entire validation to be ignored. the user can press the submit button with no validation at all being done.

any ideas?

Sign in to reply to this post

sam308940

I am still waiting for help on this. Please respond.

Sign in to reply to this post

Dani Chankhour

I apologize for not responding sooner to your ticket. I have opened a support ticket to further assist you with this issue:

supporthistory.php

Sign in to reply to this post

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...