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

When page fails validation, no feedback is given user

Thread began 10/20/2009 7:08 pm by C Claypool | Last modified 11/02/2009 1:00 pm by Jason Byrnes | 2433 views | 9 replies |

C Claypool

When page fails validation, no feedback is given user

Hi all

I have a form at
contact.php

which has two problems I would like to change:
1) I don't want the phone field to be required, and yet if you don't fill it out, the form fails to submit

2) when the form fails (either the phone issue or miss typing the captcha) it just clears the data on the form and represents it ... there is no help on what the problem is to the user.

Any help would be greatly appreciated

Sign in to reply to this post

Jason ByrnesWebAssist

1) You also have this question posted in another thread:
showthread.php?t=5847

See my reply there for removing the phone number validation.



2) Next to each field you are validating, you can type the error message that should appear if validation fails. Then select that text and apply the Validation Show If server behavior (On the server behaviors panel, click the plus button and select Validation Toolkit -> Validation Show If)

In the Validation fail section, select the server validation that should trigger the error to show and click the plus button.

Add a new validation show if behavior for each error you wish to display.

Sign in to reply to this post

Stevebo

Jason you mention the following:

"Next to each field you are validating, you can type the error message that should appear if validation fails."

When you say the error message can be typed, are you meaning we should type the error message using the Spry Effects in DW? i.e., select "Required" in Preview States in the Properties pane of DW and type a message.

Also, won't this get blown away if the form was initially created using Form Builder and a change is made in Form Builder?

You also mentioned:
"In the Validation fail section, select the server validation that should trigger the error to show and click the plus button. Add a new validation show if behavior for each error you wish to display."

Assuming my previous question was correct and the error message could be typed for each type of validation error using the Properties panel and Preview States, does this mean that when I apply the Validation Show If behavior to a text input such as First Name and it is supposed to be required (and I selected the "Enter your first name" text as the validation error message), I scrolled down to where first_name is located under the validations fail section and then clicked the plus button to add it, that a server side validation will occur for First Name being required and display the message that was typed next to the input field?

If so, do I have to create another new Validation Show If behavior for First Name if the max number of characters were exceeded?

I'm confused about clicking the plus button, what it does, and how many times the plus button could be clicked and why I would even do it multiple times in one Validation Show If behavior.

Hopefully this makes sense.

steve

Sign in to reply to this post

Jason ByrnesWebAssist

The server side validation has nothing to do with spry.

Spry is a client side javascript validation.

I will try explaining this once again:

in design view, place your cursor next to the form element and type the error message.

Highlight the error massage, then click the plus button and select Validation toolkit -> Validation Show If.

From the list of validations, select the validation that should trigger the error to display and click the plus button.

If there are multiple validations that you would like to trigger the massage, select them and click the plus button.

in other words, if you have a phone number field with Required / Not blank validation applied and Phone number validation applied, and you want the message to show if either of these fails, select them both and click the plus button.

Perhaps the Form builder documentation may help clear things up a bit.

In Dreamweaver go to Help -> CSS Form builder -> Help. Then go to Applying Manual validation -> Server Validation.


The validation message can also be set in the CSS Form Builder wizard.

In the Help documentation see the Ussing CSS Form Builder -> Editing Group Contents section.

Sign in to reply to this post

Stevebo

I see what you are saying now. I thought you were talking about the error message that shows up next to a field when spry effects exist (which they appear to do when validation occurs when using Form Builder) and can be modified by the developer to show a message.

What it sounds like you are saying is that text could be typed on the page (anywhere on the page for that matter) and when associating a Validation Show If behavior to it, it will appear when the validation fails. It would make sense to put the text next to the field since we are doing server validations for that field, but the text could be placed anywhere if we wanted.

Sign in to reply to this post

Jason ByrnesWebAssist

Yes that is correct.


Keep in mind that CSS Form Builder can use three different types of validation:
1) WebAssist Client Side (Javascript) validation.
2) WebAssist Server Side (PHP) validation
3) Dreamweaver Spry (Client Side Javascript) validation

each validation is independent of the other and has it's own error messages.

Spry validation is triggered when a form element losses focus (the javacript onBlur() event)

WebAssist Client Side validation *can* take place when a form element losses focus, but is mostly used when the form is submitted.


WebAssist Server Side validation *cannot* take place when a form element losses focus, it can only take place when the form is submitted.

Sign in to reply to this post

Stevebo

How do you determine which Form Builder validation will occur?

If I want to do server side validations using Form Builder, how do I do that?

Is the downside to me using Spry validation that if I make a change to the form using Form Builder it will lose all of the spry validation error messages I typed in?

Should we mix spry validations with form builder validations?

Sign in to reply to this post

Jason ByrnesWebAssist

By default Form bulider will use Spry validation and Server Side validation.



If you change the spry error messages after the form is created, the errors you add will be reverted if you edit the form.



The validation message can be set in the CSS Form Builder wizard.

In the Help documentation see the Using CSS Form Builder -> Editing Group Contents section. This page shows where t6o change the validation message.

Sign in to reply to this post

Stevebo

It looks to me as though the validation message that can be set only affects one thing - failed to validate. The reason why it failed is another story. For example, characters too short in a name, too many characters in a name, name entry empty (this would be the one that would fail validation and I entered an error message saying "Please enter your first name"). Any way to use those other validation error messages rather than just one validation error message? Perhaps I'm missing something but each of the cases I mention can be supplied using Spry validation whereas I think FB only supplies the error message that's associated with "required"

steve

Sign in to reply to this post

Jason ByrnesWebAssist

When you create a form using form builder, you can only apply one type of server validation to a field. it can be required not blank validation, or numeric, or phone number etc.

If you add required not blank validation, but you want to restrict the number of characters as well, you will need to edit the server validation behavior after the form is created. If you add other validation types, you will also need to create other validation messages.

Sign in to reply to this post
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...