• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

Spry Validation Issues

Hi,

I've been asked by a colleague to get a form working, not entirely when it stopped working if it has ever worked correctly, however I seem to be getting no where with it.

The form is split over 3 sections using hidden divs.  Within section 2 the submitter is asked a question.  Depending on the answer, different form fields appear.  The issue I'm having is not all the Spry validation is working as expected.

When the select list value is "none" then it should destroy the validation on the following fields within this section.  If the value is "air", it should create the validation for the arrival and departure information and destroy the hotel fields.  Else if it is "resideincountry" then it should create the validation for the hotel fields and destroy the validation for the arrival and departure fields.

I believe everything else is working but this, I've uploaded a zip file with the HTML, and associated script and images in the hope someone will be able to solve the issue.  I realise some the coding is probably not optimised so appreciate any advice with this too.

Thanks in advance.

eventForms.zip
0
john_hollings
Asked:
john_hollings
  • 3
  • 3
1 Solution
 
Jason C. LevineNo oneCommented:
Downloading and will look at it.
0
 
Jason C. LevineNo oneCommented:
Wow, that's a lot of javascript :)

First things first, when I load the page with Firebug, an error appears:

Syntax error, unrecognized expression: [@rel^="collapse-"]

Can you check that and see what it causing it?  It might be breaking the rest of the script.

0
 
john_hollingsAuthor Commented:
Thanks for the comments, I know there is a lot of JS but unfortunately we run a site that does allow us to use server-side script.

I have been using firebug but didn't see this error, I'll take another look and get back to you.

Thanks again
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Jason C. LevineNo oneCommented:
Okay.  Let me know.

We'll get this figured out but for validations this complex, I usually switch to the JQuery Form Validation plugin.  It doesn't tightly integrate into Dreamweaver but it does work a lot better (and with a lot less code).
0
 
john_hollingsAuthor Commented:
I've taken another look at the form in Firefox and cannot get this error message in FireBug.  To be honest I'm pretty new to using Firebug and all I've really used it for is to inspect elements.

I run it through IE and found a couple of errors which I have corrected but these did not correct the issue.

I've taken a look at jQuery Form Validation and it does seem simple enough however cannot see how this would work when certain fields validation need to be destroyed depending on the values selected by the submitter in a couple of the picklists.

Section 1: works fine
Section 2: if the user selects "resideInCountry" then only Hotel information is required.  If the user selects "Air" then Arrival and Departure information is required.
Section 3: works fine, if the user selects "No" then they are prompted to submit the form. If they select "Yes" they are shown a number of additional fields which are required.

I can't see how jQuery can destroy validation or build validation based on user selections, although I have only looked at it for about 30mins.
0
 
john_hollingsAuthor Commented:
I've got the form working now, not entirely sure what I did, but managed to find a could of other JS errors.  Thanks very much for your help my colleague is extremely pleased.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now