Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

flow control

Posted on 2004-09-03
4
Medium Priority
?
144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 750 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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

715 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