47 users online (1 members and 46 guests)  


  Results 1 to 3 of 3

Related

  1. Onclick menu - Help    Forum: Javascript Forum
    Replies: 10
  2. Replies: 3
  3. Dropdown menu hides behind dropdown box    Forum: Javascript Forum
    Replies: 0
  4. Dropdown Menu    Forum: HTML Forum
    Replies: 1
  5. onclick or submit not working...    Forum: Javascript Forum
    Replies: 3
  1. #1
    bemygoodday's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    2

    help using dropdown menu to influence onclick value of submit button

    I feel pretty useless not being able to figure this out... but anyway...

    Here is the situation:

    My boss wants me to make a 'time ticket' form on our website, so that employees can fill out their time cards, and send them to managers for approval. There are 9 different managers that will be receiving the form results.

    Here is what I want to do:

    I want a drop down box that will influence the 'onclick' value of my submit button, so that after filling out the form, the employee will select the manager they need to send it to for approval and hit submit, automatically mailing the results to the manager selected.


    Here is what I have... it doesn't work (clearly, or I wouldn't need help).


    <select name="recipient">
    <option value="" selected>Select Manager</option>
    <option value="email1">Natalie</option>
    <option value="email2">Betty</option>
    <option value="email3">lynn</option>
    <option value="email4">Bob</option>
    <option value="email5">Jaspar</option>
    <option value="email6">Lisa</option>
    <option value="email7">Liz</option>
    <option value="email8">Mike</option>
    <option value="email9">Vance</option>
    </select>
    <input type=button value="Submit" onClick="mailto: //here is where I would like the dropdown info to appear //">



    is this possible? or do I need to come up with something else? Any help is appreciated

  2. #2
    redlorry919's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2007
    Posts
    4

    Re: help using dropdown menu to influence onclick value of submit button

    You'll probably need to use something like php is you want it done properly. In php you'd have something like the following:

    PHP Code:
    <?php
     
    if($submit) {
      
    mail($recipient$subject$message);
    }
     
    ?>
     
    <select name="recipient">
    <option value="" selected>Select Manager</option>
    <option value="email1@domain.com">Natalie</option>
    <option value="email2@domain.com">Betty</option>
    <option value="email3@domain.com">lynn</option>
    </select>
    <input name="submit" type="hidden" value="1">
    <input type=button value="Submit">

  3. #3
    bemygoodday's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    2

    Re: help using dropdown menu to influence onclick value of submit button

    Thank you. I really appreciate your response, but I have another question.

    Do I need some sort of precursor to the php bit?

    I am rather new to this and I'm not sure what php is, but I'm using FrontPage and it highlights certain parts of code in certain colors... and the bit you gave me is just black.

    I'm sure I sound like a moron, I'm not used to feeling this stupid and this assignment is really starting to drive me nuts! Never ask a Vegetarian to do a butchers job!

    Thanks again in advance for any help.



Tags for this Thread