Generate page content depending on selections
Hi all, first time poster and very inexperienced web site creator here so go easy !
I'm trying to write a page with a series of radio buttons, and depending on the options selected when submitted a new page will be generated.
As an example, one set of radio buttons asking which colour you prefer (e.g blue, green, yellow), another set asking which size you prefer (s, m, l), and when the submit button is hit, the next page displays any cars (for example) that are the small & blue (or whatever options you selected).
I haven't really got a clue how to go about doing this, can it be done with html, javascript, dhtml?!?!...
Any help would be very much appreciated!
baldrick posted this at 12:40 — 10th July 2005.
He has: 388 posts
Joined: Apr 2005
I dont know about javascript or DHTML but it can be done with php if you have access.
lanoak posted this at 12:43 — 10th July 2005.
They have: 5 posts
Joined: Jul 2005
I don't know anything about php (although I'm pretty sure my site does support it). Any chance of enlightenment?!?!
CptAwesome posted this at 12:47 — 10th July 2005.
He has: 370 posts
Joined: Dec 2004
It's a way to dynamically generate pages with backend coding. Think Javascript before the page loads. What you're looking for sounds like it needs php, but depending on the scope of a page you're looking into, you've got a lot to learn.
lanoak posted this at 12:53 — 10th July 2005.
They have: 5 posts
Joined: Jul 2005
I've found a page which does exactly what I'm after and looking at the source code it appears to use javascript for it (and a form). Would this be using php as well?
url is: http://www.beachcomberhottubs.com/app/public/index.cfm?public=perfecttub&perfecttub=tubselector
Thanks,
CptAwesome posted this at 12:59 — 10th July 2005.
He has: 370 posts
Joined: Dec 2004
the source as you can read it, yes. php (or in this site's case it appears to be ColdFusion) the server side code is not shown in the end result, because the purpose of it is to make readable HTML, Javascript or whatever else.
lanoak posted this at 13:05 — 10th July 2005.
They have: 5 posts
Joined: Jul 2005
so am I looking at a major piece of php code here or do you think it's the kind of thing I'll be able to pick up of some 'scripts' website?... I don't mind learning php but I need to get this done in the next few days !?!...
CptAwesome posted this at 13:08 — 10th July 2005.
He has: 370 posts
Joined: Dec 2004
it sort of depends on how many cars and colours you have, and if those are the only concerns.
lanoak posted this at 13:14 — 10th July 2005.
They have: 5 posts
Joined: Jul 2005
it's going to be about 10 cars in total, with 4 different colours and 3 different sizes. That's going to be the only thing that people can select on (colour, size) and then it just returns the results the appropriate results, so sometimes there could be 4 cars returned, sometimes just 1.
demonhale posted this at 14:31 — 10th July 2005.
He has: 3,278 posts
Joined: May 2005
Im sure It could be done with javascript... I can ponder about this when I need to use it for myself... I dont have the time right now; Anyways, since you have quite a few selections, maybe you could make it logical in sequence and make it page by page like chain forwarding until they get their desired outcome...
demonhale posted this at 14:38 — 10th July 2005.
He has: 3,278 posts
Joined: May 2005
e.g by process of elimination... Make a page with all blue with small sizes, and so on... Let the selection be per page... eg. when a visitor selects blue on the first or color selection page it links to the (blue)size selection page, then when they select the size "small" it forwards you to the "blue and small sizes page"....
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.