I don't know cfselect (or cfform in general, really)... so if not using
cfform is an option, here's how it'd be done.
<form onsubmit="return checkThis(this);">
<select name="foo" id="foo">
<option value="">Please Select One</option>
<option value="A">A</option>
...
</select>
</form>
<script type="text/javascript">
function checkThis(frm) {
if (document.getElementById('foo').selectedIndex == 0) {
alert('You Failed');
return false;
}
}
</script>
On Tue, Sep 22, 2009 at 9:04 AM, Richard White <[email protected]> wrote:
>
> hi
>
> we want to have a drop down box on a form that has attribute 'required' and
> a message that displays if no value is select when the form is submitted
>
> however, using cfselect automatically makes the first option selected, but
> we want the user to physically select an option
>
> how can we code it so that no option is automatically selected when the
> page loads?
>
> thanks
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326492
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4