Solved

flow control

Posted on 2004-09-03
4
141 Views
Last Modified: 2013-12-24
Hi, I have a situation where in a form there are six input fields(all of them are 'select')
now, depending on which options the user will choose, the confirm page will only display
the values been selected. This sounds easy enough, but the problem is that i need to account
for situations where the user might select more than one field. i.e. i need to some how make room
for different combinations of the input fields. and based on these compinations the specific part of
the confirmation page will display the selected info. If one does a small calculation there is over 30
possibilities. In a normal case i would initialize a variable and set the value of this variable depending
on the selected items. But in this case i would have to write as many if elseif else statments as there
are possibilities.

This sounds like a lot of coding and html, and i'm sure there must be a way around this.
I'm new to the whole thing of web development or programing, so i cannot see the solution
help would be greatly appreicated.
thakns
0
Comment
Question by:MMsabry
  • 3
4 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 250 total points
ID: 11978172
"This sounds like a lot of coding and html..." --- That is how we keep job Dude!!!

1) If you are using MX.
use CFC for similar kind of code.
2) If there are same kind of varialbles then you should have one function and call that again and again to do similar job and this will avoid hard code and also will give you code ojbect oriented method which will give you better control over coding.
3) Ctrl + C, Ctrl + V - are helpful too ( some times)
4) Long and big code - nothing wrong with it. Just make sure that is clean and documented...

I always use isdefined('') or isstructkeyexist() to check the variable and call the function to insert or whatever...

Well...there are lot to write... I discussed some basic ... other expert will write more... i am also new to this area...
Regards,
---Pinal

0
 

Author Comment

by:MMsabry
ID: 12039998
thanks pinal,
I have found a solution, still using a number of switchs and if-elseif-else's but it is runnig smoothly now.
one comment about cfc, they are ok, but there are other ways, UDF for example and one of the best things i found out, were the use of include tag.

CFC are very slow to initialize and that is not a good thing.
I will just wait for a while maybe other experts have some comments
thanks!
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 12040407
okey buddy  no problem.
Regards,
---Pinal
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 12227126
Thanks and have a good day!
---Pinal
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question