Results 1 to 4 of 4

Thread: Two Questions:

  1. #1
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default Two Questions:

    I have an Emailing script in PHP, but I need a JS function to finish a feature. I have a <select> tag with the users friends. When the user clicks, how can I write the name in the "to" box with out refreshing or changing the page? I know that I could just catch it in PHP via the <select> tag, but people are more used to seeing it in the To: box.

    Secondly, do you know of any good drop down menu tutorials? Really *good* ones for those of us who know how to code (in PHP) but suck at JS.

    Thanks!
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #2
    Join Date
    May 2007
    Location
    Canada
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey Jas,

    I don't have any drop down menu tutorials in my favourite, but I would recommend http://www.w3schools.com . Plus, try googling, you'll find a lot out there.

    As for your <select> tag feature, you could try the following. Not sure if this is exactly what you want.

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Select Address</title>
    
    <script type="text/javascript">
    
    function addressSelected(selectField)
    {
    	document.getElementById("toAddress").value = selectField.value ;
    }
    
    </script>
    
    </head>
    
    <body>
    
    To: <input id="toAddress" type="text" size="50" ></input>
    Select Address:
    <select id="selectTest" onChange="addressSelected(this) ;">
    	<option value="friend1@dynamicdrive.com">Friend 1</option>
    	<option value="friend2@dynamicdrive.com">Friend 2</option>
    	<option value="friend3@dynamicdrive.com">Friend 3</option>
    	<option value="friend4@dynamicdrive.com">Friend 4</option>
    	<option value="friend5@dynamicdrive.com">Friend 5</option>
    	<option value="friend6@dynamicdrive.com">Friend 6</option>
    	<option value="friend7@dynamicdrive.com">Friend 7</option>
    </select>
    
    </body>
    </html>

    ______________________

    Regards

    Pman
    http://www.pmansLab.com

  3. #3
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    What an obvious answer for the select script lol. I can't beleive I couldn't figure that out . . . .Well thanks much!
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  4. #4
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Is there a way to do this by a double click? onClick is a single click, that's about all I know . . .

    NVM I found the answer on www.w3schools.com
    Last edited by Jas; 05-26-2007 at 11:56 PM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

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
  •