Welcome to WebmasterWorld Guest from 107.20.54.98

Forum Moderators: open

Message Too Old, No Replies

Creating "Required Fields" in Dreamweaver

How do you do this? Help

     
7:04 am on Dec 2, 2005 (gmt 0)

New User

10+ Year Member

joined:Nov 9, 2005
posts:6
votes: 0


I am trying to figure out how to create a required field in Dreamweaver! My dreamweaver bible doesn't even explain this common function seen in many forms seen on web-pages. I would like to make the NAME and EMAIL address fields compulsory to fill in before the form can be submitted.

If anyone can help, would really appreciate this!

Thanks

Louise

7:16 am on Dec 2, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 9, 2003
posts:815
votes: 0


If I can remember correctly, there is no DW function to do this. You can use several types of add-ons.

I personally use javascript.

Just search for javascript form validation

8:41 am on Dec 2, 2005 (gmt 0)

New User

10+ Year Member

joined:Nov 9, 2005
posts:6
votes: 0


cool, thanks
10:31 am on Dec 2, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 14, 2003
posts:1550
votes: 0


Hi Louise,

How good is your knowledge of Javascript. If you just want to get on with having your form checked and don't want to have to hand code too much, I would suggest trying to find free DW extensions.

The one I can recommend can be found if you google for 'yaromat' - (mods: I have no affiliation with him).

Although JS form checking is good I would also advise to use server side checking (if you use a script to email you the form).

If you use matts script - again no affiliation ;-) - or any of its variations, you have a built-in facility fo check for required/mandatory fileds using the <input type="hidden" name="required" value="yourmandatoryfieds, separated, bycomas" />

The use of server-side checking is good because some people have javascript disabled so they might make a mistake but most importantly it will block some spiders/bot that could 'form-spam' you.

Hope this helps

[edited to fix some typos]

[edited by: le_gber at 10:33 am (utc) on Dec. 2, 2005]

10:31 am on Dec 2, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member beedeedubbleu is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 3, 2004
posts:6099
votes: 6


Dreamweaver can do this and it is quite straightforward. You can find details of how it is done by going to DW help menu and typing in "validate form action" (in quotes).
12:11 pm on Dec 2, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 5, 2002
posts:1713
votes: 0


Yes, as I use Matts Script,

<input type="hidden" name="required" value="yourmandatoryfieds, separated, bycomas" />

is all I need use.

6:25 pm on Dec 2, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 18, 2004
posts:61
votes: 0


when in DW just click on your submit button once to select it, go to you behaviors panel(Window>Behaviors) select the + sign and choose Validate Form from the dropdown. Should be pretty easy after that.