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 Coder
    Join Date
    Oct 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box w/description modification help

    This is the script I am refering to

    http://www.javascriptkit.com/script/...descrip1.shtml

    This works perfect for what I need but was wondering if it is possible to make these modifications to it.

    First of all in the description area, is it possible to put in a line break? It makes the box more readable. I don't know a lot about javascript and obviously the <br> doesn't work it just comes out as written.

    Second is it possible to make the links open in another window? I tried a few things with the "gothere" function but couldn't get it to work.

    So is it possible to do those things and if so How?

    Thanks for your help

  • #2
    New Coder
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    76
    Thanks
    0
    Thanked 6 Times in 6 Posts
    To put line breaks in the text add in a backslash and then the character 'n' where you want the break to be. \n is the escape character for a newline.

    Example:

    Code:
    descriptions[1]="The newline will appear here,\n this text is on a new line."
    Yes you can make the links open in a new window - replace the goThere function with this code...

    Code:
    function gothere(){
    window.open(shortcut.example.options[shortcut.example.selectedIndex].value);
    }
    Cheers,
    DouG

  • #3
    New Coder
    Join Date
    Oct 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, worked perfectly. I appreciate the help


  •  

    Posting Permissions

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