...

View Full Version : Combo Box w/description modification help



Markxxx
10-22-2006, 08:01 PM
This is the script I am refering to

http://www.javascriptkit.com/script/script2/combodescrip1.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

DougMck
10-26-2006, 04:37 AM
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:



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...



function gothere(){
window.open(shortcut.example.options[shortcut.example.selectedIndex].value);
}


Cheers,
DouG

Markxxx
10-26-2006, 08:25 PM
Thanks, worked perfectly. I appreciate the help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum