PDA

View Full Version : Validate Form Problem


aargus07
09-27-2007, 05:19 PM
Using DW8, I have a Submit Form with a behavior attached to the
Submit Button that validates the form "On Submit". When editing this
Validate Form behavior, DW displays a list if fields that one can
check as being "Required". All this works fine for me except that
the list will only display fields that are by default entirely blank.
If , for example I have a pulldown selector that has a default
dash - as the selection, the pulldown will not show as being
able to mark "Required".

DW does not let you create a pulldown with an option
that is blank; one needs to put something in every slot even
if it is only a dash to indicate empty. How can I tackle this
one?

Thanks,

Dan

Ricky55
09-28-2007, 09:23 PM
The vaildate form behaviour that ships with dreamweaver is basic as you're discovering. Try installing a more advanced validation extension.

Search Google for:-

form validation extensions for dreamweaver

davidj
09-29-2007, 10:43 AM
or even learn how to use javascript to write your own validation

example

to target a field element value


document.getElementById('id').value // target element


to set a value


document.getElementById('id').value = "2"; // target element and set value of element


to check a value


document.getElementById('id').value == "2"; // target element and check value == 2 - boolean true or false