Not complete but should give you the general idea.
you could simplify this but I think this is clearer/easier to understand. I
usually find that usefull about 6 months from the present.
function validateMe() {
var thisSelectionIdx = document.forms["thisForm"].cardtype.selectedIndex;
var thisSelectionValue =
document.forms["thisForm"].cardtype.options[thisSelectionIdx].value;
if (thisSelectionValue == 'unknown') {
// raise error
return false;
}
else {
document.forms["thisForm"].submit();
}
}
<form id="thisForm" name="thisForm" onSumbit="validateMe()">
<cfselect name = "cardtype">
<option value = "unknown"> Plseas Select </option>
<option value = "v">Visa
<option value = "m">Master Card
</cfselect>
Steve Budan
Cold Fusion Developer
Baxter Corporation
AUTROS POINT OF CARE System
One Yorkdale Road, Suite 310
Toronto, ON M6A 3A1
(416) 784-1100 ext. 182
-----Original Message-----
From: Mike [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 4:25 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFTALKTor] CFSELECT
But when I do that visa is automatically showing, if they don't pay
attention all cards will be visa.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 04, 2002 3:59 PM
Subject: [CFTALKTor] CFSELECT
>
> One way to do it is to not have any blank options. It would look
something
> like this:
>
> <cfselect name = "cardtype">
> <option value = "v">Visa
> <option value = "m">Master Card
> </cfselect>
>
> Depending on your application, you don't have to list all card types, just
> the ones the company honours.
>
> *************************
>
> I would like to make a combo box using CFselect, I want to force the
person
> to select one credit card type.
>
> So I made a CFselect box and clicked on required and entered a message.
> But no validation takes place?
>
> Can any tell me how to use this function, I don't necessarily want to
> check the values on the next page, I would like to do on the same page.
> All our browsers here have javascript enabled.
>
> Thanks
>
> Mike
>
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: [EMAIL PROTECTED]
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Mike" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: Steve Budan <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)