|
Might be a little easier to read with a
select/case ;) It works just like the CF one, except you need
to use a break statement where you want it to stop processing. (pretty
powerful that way - can have multiple case blocks cascade)
function checkCCAccount(Ticket)
{
var pmt = Ticket.PaymentType.options[Ticket.PaymentType.selectedIndex].value; switch(pmt){ case 1: alert(pmt + "You must enter the account information if you are paying by Corporate Check"); break; case 3: case 4: case 5: case 6: alert(pmt + "Please note that your credit card will be process at the time of the service call"); break; } } a lot of people dont realize you can do the same
thing in cold fusion - have a multiple values for a single
case statement with delimiters in it. i.e. -
<cfswitch
_expression_="#myValue#">
<cfcase value="1,2"> <!--- for values 1, 2 ---> </cfcase> <cfcase value="3,4,5,6"> <!--- for values 3, 4, 5, 6 ---> </cfcase> </cfswitch> just a tid bit that gets overlooked a lot it seem,
so worth mentioning :)
-Nate
|
- JavaScript Bruce Sorge
- RE: JavaScript Jacob Cameron
- Re: JavaScript Bruce Sorge
- RE: JavaScript Daniel Elmore
- RE: JavaScript Jacob Cameron
- Re: JavaScript Nate Nielsen
- Re: JavaScript S . Isaac Dealey
- Re: JavaScript Kevin McGlynn
- Re: JavaScript rick
- Re: JavaScript S . Isaac Dealey
