Solved

flow control

Posted on 2004-09-03
4
143 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 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

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

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

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…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

630 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