Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Javascript task

Thread Tools

Javascript task

dsmith1984uk dsmith1984uk is offline
Junior Member
Join Date: Oct 2010
Posts: 1
Hi people I'm hoping someone can help me.
I have NO knowledge of Javascript but I'm not afraid of code and happy to look at it and work out what is doing what.

I need someone to provide me with a small sample of code to get me started on this task.

I need a webpage with a number of drop down menus.
Depending on what the user selects in these menus, depends on what sentence or paragraph is then displayed in a box.

For example you might have a page dedicated to food. So the user would select egg in the first drop down and the box will change to display "you can't make much with that on it's own".#
You'll then select flower in the second and it'll adjust to a paragraph maybe explaining where you could go next with that.

In my page I need 6 drop down menus with about 8 choices in each menu (nothing related to food).
Not sure if I would need to tie this in with a database or if I could just make do with the code on the page.

As I said I'm hoping someone can just kick me off with something do I can get a rough idea of how I would go about coding it.
Maybe an example contain 3 drop down menus with 2 choices on each and a few possible sentences or paragraphs that it could generate in a box.

If not then any advice would be really appreciated as I said I'm a complete newbie and I've never even looked at Javascript code to my knowledge.

Many thanks
Reply With Quote
pramodpramodpramod pramodpramodpramod is offline
Junior Member
Join Date: Oct 2010
Posts: 1
I think this will be an ideal case for using server side programming as the number of dropdowns and options are more. This will allow you to
a) maintain dynamic list. For example user selects value "Egg" in first dropdown list. the options in the second list can dynamically change to ones that are relevant for the "Egg" option in the first list.
b) have more control over the response which can rendered based on user's selection in every dropdown. Such a list can be maintained at the back end in db or XML or config files.

If you dont want the page to be posted back to server and refreshed everytime after the user selects something in every dropdown list, you can use Ajax to get the response from the server. This will infact be an ideal situation to use jquery which would make the front end script coding much much easier.

I hope this helps. If you are still bent on doing this completely using browser side scriptingm let me know and I'll try and work out something for you (but remember it will be complicated considering the number of options and the combinations possible)

Pramod Mohanan
Reply With Quote

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
stop org.jdesktop.application.Task started using @Action public Task Mike Java 1 05-12-2008 12:09 PM
[Rake] call a task of a namespace from an other task. Stéphane Wirtel Ruby 3 06-15-2007 06:52 AM
Accessing ant task name when running a task teggy Java 0 05-29-2007 02:20 PM
Maven using ANT plugin for SCP task : Embedded error: Could not create task or type of type: scp. krabhi Java 1 08-09-2006 04:19 PM
Re: Problem in ant replace task and replaceregexp task to update xml Victor Java 0 09-01-2004 03:58 AM