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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up try to solve this

    Hi Guys,

    plz try to solve this problem

    I have a dropdown box with values and I need to display the selected value near the dropdown box in a label and cannot use textbox or anyother box, this should be dynamic and so whenever I change my selected value the text should also change, remember that I cannot use textbox or button, just plain text, if you can plz mail me the code at pratikmodi@rediffmail.com

    Thanks and Regards
    Pratik

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Welcome to the forum. Next time you should put a more descriptive subject. Read the posting guidelines.
    Back to your problem..
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function displayValue(objSel){
       document.getElementById('desc').innerHTML = objSel.options[objSel.selectedIndex].value;
    }
    </script>
    </head>
    <body>
    <form>
    <select name="s" onchange="displayValue(this)">
    <option value="">--Select one---</option>
    <option value="This is item 1">item 1</option>
    <option value="This is item 2">item 2</option>
    <option value="This is item 3">item 3</option>
    </select>
    <span id="desc"></span>
    </form>
    </body>
    </html>

  • #3
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Hi,

    Thanks u very much for the prompt reply and help, it is working.

    Regards
    Pratik


  •  

    Posting Permissions

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