|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
a cfscript question
new at this and could use a nudge in the correct direction as to what I did wrong. setup a cfscript tag as follows: <cfscript> divisionManagers = arrayNew(1); divisionManagers[1] = "Here lies the contect that describes the first of 9 division managers (and they all look like this)."; function showDivision() { If (IsDefined("url.intDivNum") And (("url.intDivNum") lte 9) And (("url.intDivNum") gte 1)) WriteOutput(divisionManagers[url.intDivNum]); Else WriteOutput('Click on the division name to see more information.'); } </cfscript> with a cfoutput tag calling the function name, and all it'll display is the else part of the function. Any assistance would be appreciated. |
|
#2
|
|||
|
|||
|
script question answered...
Your if is testing the actual string "url.intDivNum" instead of its value. Try the line below.
If (IsDefined("url.intDivNum") And (url.intDivNum lte 9) And (url.intDivNum gte 1)) You also might be better off to always use cfparam for all expected variables in a page. ie at the top of the code: <cfparam name="url.intDivNum" value=0> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > a cfscript question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|