LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-21-2009, 01:23 PM   #1
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
mixing a radio button or drop down box into a list of checkmarks dynamically?


here is my problem

I am creating a php based, e-commerce type site where a user can order a custom product based on a list of available options, however some of them are an either this or that, so a simple list of check boxes wouldn't be quite adequate

for instance as an entertainment system might be

CD player
turntable
cassette deck
VCR
DVD player
blue-ray player
8 track player
40 watt receiver, 50 watt receiver OR 100 watt receiver
10" woofers, 12" woofers, or 15" woofers
25" plasma TV, 25" LCD TV, 52" LCD TV etc...

of course the cd player through the 8 track player can be checkboxes since you either add that item or you don't but obviously it would be preferable to have either radio buttons for the speakers, tvs, and receivers since you arent gonna order more then one tv, receiver or set of speakers

how can I, reading from a single array, tell my script whether a given item in the list belongs as a check box or part of the appropriate radio button group or drop down list?

Last edited by frieza; 02-21-2009 at 01:25 PM.
 
Old 02-21-2009, 02:03 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You've got two related - but logically separate - design issues:

a) Design of the "presentation" (what is the HTML the user will see)?

b) Design of the "back end" (what is the program logic needed to create the HTML? What data and data attributes is that program logic going to need)?

STRONG SUGGESTIONS:
1. Mock up a couple of prototypes of the "presentation".
First in pencil-and-paper, then some quick'n'dirty HTML

2. Draft your schema.
If CD's need checkboxes, but speakers need radio buttons, maybe (for example) you need a "singleOption/multipleChoice" flag in your data record.

3. Don't worry about the PHP coding until *after* you're clear about the "data" and "presentation" layers.

'Hope that helps .. PSM

PS:
If ordering an MP3 player is easy ("I want this model or that model"), but ordering a home entertainment system is complex (every module has lots of inter-related options), maybe you want to create some kind of "wizard" for your presentation (walk the user through a set of web pages to help him selecting the right components).

Just a thought...

PPS:
???8 track player??? Did you say "8-track player"?!? Just curious... ;-)

PPS:
What about '78's? Or 45's? Some original Artie Shaw (or Spike Jones ;-)), on acetate?

Last edited by paulsm4; 02-21-2009 at 02:06 PM.
 
Old 02-21-2009, 02:11 PM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Original Poster
Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Quote:
Originally Posted by paulsm4 View Post
Hi -

You've got two related - but logically separate - design issues:

a) Design of the "presentation" (what is the HTML the user will see)?

b) Design of the "back end" (what is the program logic needed to create the HTML? What data and data attributes is that program logic going to need)?

STRONG SUGGESTIONS:
1. Mock up a couple of prototypes of the "presentation".
First in pencil-and-paper, then some quick'n'dirty HTML

2. Draft your schema.
If CD's need checkboxes, but speakers need radio buttons, maybe (for example) you need a "singleOption/multipleChoice" flag in your data record.

3. Don't worry about the PHP coding until *after* you're clear about the "data" and "presentation" layers.

'Hope that helps .. PSM

PS:
If ordering an MP3 player is easy ("I want this model or that model"), but ordering a home entertainment system is complex (every module has lots of inter-related options), maybe you want to create some kind of "wizard" for your presentation (walk the user through a set of web pages to help him selecting the right components).

Just a thought...

PPS:
???8 track player??? Did you say "8-track player"?!? Just curious... ;-)

PPS:
What about '78's? Or 45's? Some original Artie Shaw (or Spike Jones ;-)), on acetate?
i did say 8 track player
actually my site isn't selling entertainment centers that was just a generic example
thx though

Last edited by frieza; 02-21-2009 at 02:22 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable wireless internet/radio button phodopus Slackware 5 05-21-2008 03:45 AM
2 jtextField must work like radio button groups xface66 Programming 2 09-11-2007 09:54 AM
how can I find the length of all radio button? rblampain Programming 3 08-12-2007 09:35 PM
After battery died, radio button for wireless doesn't work! Shioni Linux - Hardware 3 11-16-2006 02:01 PM
php radio button question jabfinger Programming 5 08-14-2005 10:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration