Developer forum
E-mail notifications
Validation for "required" fields in Forms (DW7)

Mads Zangenberg
Posted on 09/08/2011 15:52:05
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










Posted on 10/08/2011 09:55:42
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
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
Posted on 23/08/2011 20:34:42
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
Posted on 19/06/2014 13:17:22
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
Posted on 19/06/2014 15:36:39
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