Javascript task

Discussion in 'General Computer Support' started by dsmith1984uk, Oct 15, 2010.

  1. dsmith1984uk

    dsmith1984uk

    Joined:
    Oct 15, 2010
    Messages:
    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
     
    dsmith1984uk, Oct 15, 2010
    #1
    1. Advertising

  2. dsmith1984uk

    pramodpramodpramod

    Joined:
    Oct 16, 2010
    Messages:
    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)

    Cheers,
    Pramod Mohanan
     
    pramodpramodpramod, Oct 16, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chris

    javascript to applet

    chris, Aug 3, 2003, in forum: Firefox
    Replies:
    0
    Views:
    1,031
    chris
    Aug 3, 2003
  2. chris

    javascript to applet

    chris, Aug 3, 2003, in forum: Firefox
    Replies:
    0
    Views:
    916
    chris
    Aug 3, 2003
  3. James
    Replies:
    1
    Views:
    992
    James
    Sep 28, 2003
  4. Quivis
    Replies:
    2
    Views:
    3,430
    Quivis
    Oct 5, 2003
  5. Shane

    To Javascript, or not to Javascript

    Shane, Aug 29, 2005, in forum: NZ Computing
    Replies:
    5
    Views:
    472
    Waylon Kenning
    Aug 30, 2005
Loading...

Share This Page