close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

validation conflict

Thread began 8/15/2014 3:30 am by Jamie | Last modified 8/15/2014 8:55 am by Jason Byrnes | 998 views | 5 replies |

Jamie

validation conflict

Hey Jason

I seem to have a conflict on the attached page.

First off, not sure if I have set up the validations correctly as havent used 2 before and have set up 2 different validations (should they be in one?)

The 2 validations I have are to check that the CompanyName field is not blank and to check it is a unique name.

On clicking insert (and leaving the CompanyName field blank) thewrong error is shown. It should show 'Company Name Required' but instead it shows the error if the company name is already being used....

Not sure what I have done wrong.

Many thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

  First off, not sure if I have set up the validations correctly as havent used 2 before and have set up 2 different validations (should they be in one?)  



yes, this is the problem, you should not be using 2 instances of the server validation behavior, you should one instance of the server validation behavior and define all of the validation in that one instance.

Sign in to reply to this post

Jamie

I had tried that but when insert button is pressed and the field is empty, both error messages show (when it should be just the required field one). if the field has content and is not unque, then only the uniw error message shows (as it should)

I have redone it again just now (and attach the file) and still get that same problem

Sign in to reply to this post

Jason ByrnesWebAssist

That is the way the unique validation works, The unique validation does not allow for blank value, so if the valuer is left blank both the unique and required validation will occur.


i guess you could add an if statement around the line for the unique validation so it will only be processed if there is a value:

if((isset($_POST["TestimonialCompany"])) && $_POST["TestimonialCompany"] != "") {
$WAFV_Errors .= WAValidateUnique("PowerCMSConnection",$PowerCMSConnection,$database_PowerCMSConnection,"testimonial","TestimonialID","none,none,NULL","0","TestimonialCompany","',none,''","".(((isset($_POST["TestimonialCompany"]))?$_POST["TestimonialCompany"]:"")) ."",true,2);
}
Sign in to reply to this post

Jamie

ah ok thanks Jason

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

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