Results 1 to 2 of 2

Thread: Drop Down Menu Auto Select

  1. #1
    Join Date
    Feb 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop Down Menu Auto Select

    In our directory when a user logs in to change their info, the form is auto filled with their initial selections saved in our database.

    This is accomplished by placing a small tag into each field such as %%url%%

    Code:
    <input type="text" name="url" size="30" value="%%url%%" />
    I want to do the same with a drop down menu but this wont work the same way it does for a field.

    Is there a script out there that would allow me to use our %%tags%% in a drop down menu?

    thanks

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Well, what you could do is this:
    Code:
    <input type="hidden" id="foo" name="url" size="30" value="%%url%%" />
    
    Dropdown menu?
    
    <select id="menu">
    	<option></option>
    </select>
    <script type="text/javascript">
    $ = function(e) {return document.getElementById(e);};
    var text = document.createTextNode($("foo")["value"]);
    $("menu")["options"][0].appendChild(text);
    </script>
    - Mike

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
  •