Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts

    text placement question

    I want the inserted text to be under the droplist not on top of it!

    <html>
    <body>

    <script type="text/javascript">
    function showSelected(val)
    {
    document.getElementById('selectedResult').innerHTML="<a href='mailto:" + val + "'>" + val + "</a><p><font size=3></font>&nbsp;</p>"
    }
    </script>

    <div id='selectedResult'></div>
    <!-- This sets up the drop down list of names -->
    <select name='test' onChange='showSelected(this.value)' ID=Select1>
    <option value='user.1@email.net'>First User</option>
    <option value='user.2@email.net'>Second User</option>
    </select>

    </body>
    </html>
    Last edited by DanielHowden; 11-14-2010 at 02:54 PM.

  • #2
    New Coder
    Join Date
    Mar 2010
    Location
    New Jersey USA
    Posts
    81
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by DanielHowden View Post
    I want the inserted text to be under the droplist not on top of it!

    <html>
    <body>

    <script type="text/javascript">
    function showSelected(val)
    {
    document.getElementById('selectedResult').innerHTML="<a href='mailto:" + val + "'>" + val + "</a><p><font size=3></font>&nbsp;</p>"
    }
    </script>

    <div id='selectedResult'></div>
    <!-- This sets up the drop down list of names -->
    <select name='test' onChange='showSelected(this.value)' ID=Select1>
    <option value='user.1@email.net'>First User</option>
    <option value='user.2@email.net'>Second User</option>
    </select>

    </body>
    </html>

    Code:
    <html>
    <body>
    
    <script type="text/javascript">
    function showSelected(val)
    {
    document.getElementById('selectedResult').innerHTML="<a href='mailto:" + val + "'>" + val + "</a><p><font size=3></font>&nbsp;</p>"
    }
    </script>
    
    
    <!-- This sets up the drop down list of names -->
    <select name='test' onChange='showSelected(this.value)' ID=Select1>
    <option value='user.1@email.net'>First User</option>
    <option value='user.2@email.net'>Second User</option>
    </select>
    <div id='selectedResult'></div></body>
    </html>
    Like that?

  • Users who have thanked connollyc4 for this post:

    DanielHowden (11-13-2010)

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,915
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    This is not a javascript issue.

    Just move your <div> to the desired postion - after the select list.

    Note that if you use onchange you must have a default such as "Select User" as otherwise user1 can only be selected by first selecting user2.

    Do please read the posting guidelines regarding silly thread titles. This is the second thread today with the same silly title. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful.

    Also rememember when posting here to use [ code ] tags.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
    Last edited by Philip M; 11-12-2010 at 05:02 PM.

  • Users who have thanked Philip M for this post:

    DanielHowden (11-13-2010)

  • #4
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts
    thanks for the reply guys. I am sorry that it was not the javascript that was the issue. I am new to this and I thought it was. Sorry.

    Daniel.


  •  

    Posting Permissions

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