Results 1 to 6 of 6

Thread: Select an email address to send a form to

  1. #1
    Join Date
    May 2007
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Select an email address to send a form to

    Hi everyone,

    Is it possible to use javascript in a form to create something like the following:

    Please select the department you'd like your question to go to:
    Then have a radio button/drop down menu selection of departments--when a department is selected and the submit button on the form is pressed the form will only go to that particular email address?

    Thanks for any suggestions.

  2. #2
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    You could have a hidden input with the email address as the value, and have the value change depending on which radio button/drop down item is picked.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  3. #3
    Join Date
    May 2007
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the response! Stupid question...what would I need to do get the value to change?

  4. #4
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Nah, not a stupid question. I'm not very good at writing JavaScript, but I have a good understanding of what you can and cannot do with it.

    Basically, what you want to do is something like if radio button equals, say, Robert, input.value='this'. If radio button equals Joey, input.value='that'

    Make sense? The input.value='whatever' isn't totally right, but it's the basic idea.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Do all the checking in your server-side script. Do not pass an email address straight to the server-side script from the client-side.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    May 2007
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default thanks for all the suggestions!

    Thanks for the help everyone.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •