I do something similar, but run into problems with page caching.
For instance, if an item was added to the database table the populates the
drop-down, between the time you submitted, and hit the OK button to the
alert box, the new item will not appear in the drop down.
The only way around this that I can see is to force no caching of the form
page. Unfortunately, enforcing no caching introduces some other little
issues (Data Missing messages when hitting the back button).
So, I think we will be moving to JS validation on the submitting page -
which would resolve these issues.
Hope this info helps someone.
Shawn Grover
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 16, 2001 6:41 AM
To: CF-Talk
Subject: RE: Javascript Validation & Coldfusion ?
I tend to place the js in the action page, assuming the dropdown is in a
form.
This is what I use to force someone to select a value from a prefix field.
<CFIF parameterexists(FORM.NAME_PREFIX) IS "no" or #trim(FORM.PREFIX)# is
''>
<SCRIPT Language="JavaScript">
alert("Please Select a Prefix");
history.back();
</SCRIPT>
<CFABORT>
JoAnn A. Schlosser
Senior Consultant
Association Management Software
Grant Thornton LLP
Washington, D. C.
703.837.4428
This e-mail is intended solely for the person or entity to which it
is addressed and may contain confidential and/or privileged information.
Any review, dissemination, copying, printing or other use of this e-mail by
persons or entities other than the addressee is prohibited. If you have
received this e-mail in error, please contact the sender immediately and
delete the material from any computer.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists