Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Spry Validation

Community Beginner ,
Jul 15, 2009 Jul 15, 2009

Hi there,

I am trying to use the spry validation in my form. But that form has already a server side validation in the form element.

When I try to insert the spry validation for a text field for example I have this error message:
"While executing inspectSelection in spry_ValidationTextField.htm, a JavaScript error occurred."

Does it mean that I cannot put a Spry validation after I've inserted a PHP validation?

What am I doing wrong?

Help me please.

Thank you!
boco

boco

TOPICS
Server side applications
691
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 15, 2009 Jul 15, 2009

Just hand code the validation into the page and it should work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 18, 2009 Jul 18, 2009
LATEST

Having both client side JavaScript and server side validation is a good "belt and suspenders" tactic, especially if you are making sure the right kind of data is submitted to avoid errors on the database. Trying to mix your validation within the form itself could get messy however. You might want to try this...

Have all the Spry validation in the form to "pre test" your data before it's ever submitted. This will catch 95% of the problems.

If you really want to be 100% sure, you can include a block of server side validation on the target page for the form before you process any of the data. If any of the data fails you send the user back to the form, re populate the form with the form variables they sent the first time and display an error for the field that failed.

Sorry, this isn't as simple of an answer as you may have been looking for, this requires quite a bit of coding, but it's a 100% sure way to validate the data before writing it to your database.

Hope this helps.

--
Lawrence   *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines