Brandon,

Check out qForms:
http://www.pengoworks.com/qForms/

It has all sorts of really easy to use validation methods. For example, to
make sure they select a state, you could just do:

obj.fieldName.validateState();

or to simply check that the value was not blank:
obj.fieldName.validateNotEmpty();

or you could expand the above and provide a custom error message:
obj.fieldName.validateNotEmpty("You must select a state from the drop down
list.");

That's it! This is just the tip of the iceberg as well, it's very, very
flexible and very easy to use.

-Dan

> -----Original Message-----
> From: Brandon Wood [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 29, 2001 5:13 PM
> To: CF-Talk
> Subject: Silly Validation Question...
>
>
> Hey,
>
> Does anyone have a good script or method of making a select box contain a
> value other than ""?
>
> I am working on a state drop-down in which the first selection is "Pick
> State" with a value of "".
>
> What I want to happen is for a javascript screen to pop up (or something
> like that--you know the usual CFFORM javascript validation) if a
> user tries
> to submit the form without choosing a state that has a value.  I
> have seenm
> this used many times and even with CFSELECT form fields, but I am
> having the
> worst time trying to implement this.
>
> I want to populate the CFSELECT with a query from a State_Table but do not
> want to store a state with a value of "" as not to populate a state field
> with NULL answer.
>
> Is there an OnError or someother Javanscript function that could make sure
> that a value other than "" was chosen and that the error message could be
> configurable.  I know that this is so CF 101, but I have never had to do
> this and am pulling my hair out in anger.
>
> Thanks a ton,
> BW
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to