Developer forum

Forum » Templates » Validation for "required" fields in Forms (DW7)

Validation for "required" fields in Forms (DW7)

Mads Zangenberg
Reply

Hi all,

I am quite new at DW, therefore this question may be basic for some.
I have built a form for my guests to fill on our website, and I'd like to make some of the fields obligatory/required. I learned from DW support that it wasn't enough to just tick the "required" box when setting up the form, but that some JavaScript was necessary to do the job.

I am totally NON-JavaScript expert, so is there a simple line of code, which I can use to achieve this simple goal? If so, I'd appreciate greatly seeing an example of it, and also to know where I need to insert it (in the "validation value" field at the bottom of page when field is highlighted maybe?).

Any help is welcome!

In advance thanks very much and kind regards,
Olivier

Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi there,

You could take a look at a jQuery and its validation plugins, such as this one: http://docs.jquery.com/Plugins/validation

They still require some knowledge of JavaScript, but not as much as you would need if you started this from scratch.

Cheers,

Imar
 
David Matheson
Reply

Hi

The page http://grublestova.no/dynamicweb/dynamicweb-modules/dynamicweb-forms-dw7.aspx  shows you how to set up and enable validation in Dynamicweb Forms (v7) with a working example here: http://grublestova.no/dynamicweb/dynamicweb-modules/dynamicweb-forms-dw7/dynamicweb-forms-validation.aspx 
David
 
Lise T. Pedersen
Reply

I have used the "Grublestova" validation for several forms now, and it's working.

The only thing I would like to be different, is that the error message contained the "Field.Description" instead of the "Field.Systemname", I think that would be more userfriendly. 

But is it possible to make this change? I have looked in the javascript code, but ...

/Lsie

 
Nicolai Høeg Pedersen
Reply

Hi Lise

It seems like there is a small error in his template.

<label for="<!--@Field.Name-->"><!--@Field.Label--></label>

should be

<label for="<!--@Field.Systemname-->"><!--@Field.Label--></label>

BR Nicolai

 

You must be logged in to post in the forum