Solved

flow control

Posted on 2004-09-03
4
130 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
Comment Utility
"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
Comment Utility
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
Comment Utility
okey buddy  no problem.
Regards,
---Pinal
0
 
LVL 21

Expert Comment

by:pinaldave
Comment Utility
Thanks and have a good day!
---Pinal
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now