Advanced Search

Results 1 to 3 of 3

Thread: Email Form (not just a simple one)

  1. #1
    Join Date
    Nov 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Email Form (not just a simple one)

    I need a script that emails the result and it needs to have fields like:

    Student Name:
    Email:
    Teacher:
    Student ID:

    But on TEACHER, i need it to be a dropdown list, and when you choose a certain teacher, it changes the email who you are emailing to. So the teacher gets the email. NOT all of the teachers on the list, just the one that is selected.

    Thank You,
    Austin

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    There are two components to "email forms".

    1. There is code that actually gets the data and sends it by email. This is done in a server side language like PHP, ASP, etc. You can either make this yourself or use a free service to send it for you. (You determine this by the action of the form.)

    2. The form itself is just plain html. You don't need a "script" for this, but just regular html code for the various fields/inputs. You can add to this using Javascript, but remember that javascript is not reliable because user shave it disabled.

    The easiest way to deal with this is to have a database or just list when interpreting the data. Use the dropdown to select the name (no javascript needed), then use PHP or another server side language to find the corresponding email address and send the email to that. However, this means that you must write the script yourself for sending the email.

    The other way (actually perhaps easier), though it means people can find the teacher's emails directly, is to just use a regular select menu. For each option make the value the email and the label the teacher's name. Very simple, very effective, and will work every time.

    Of course you can also do this dynamically with Javascript, but I really don't see the point here. That will mean that it won't work for users with javascript disabled, and also that the users will be able to see the teacher's emails, so spam bots can find them, etc. In that case, it is probably better then to use the second method above.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,623
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I agree that php would be the way to go. Everything could be set up in the PHP script as well (an associative array holding all the teacher's names and emails), eliminating the need for a database.

    I could design this for you, if you were looking for paid help, or I'd be happy to answer questions if you decided to try yourself.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

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
  •