Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

flow control

Posted on 2004-09-03
4
Medium Priority
?
145 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 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

971 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