...

View Full Version : Trying to change a nice list of items to a drop down box



claymaker
09-16-2005, 02:40 PM
This is the section Im working on
Trying to change a nice list of items to a drop down box see pic



document.write("<input type=file name=\"addtargeturl\" size=20 style=\"font-size:9pt\">")

document.write("<input type=button value=\"Insert Image\" onClick=\"addtarget()\" style=\"font-size:9pt\"><br><br></right>")

document.write("")

document.write("<a href=\"javascript:targets(\'targets/1.gif\')\"><font size=2 color=003300>4 Ring Black</font></a><br>")


document.write("<a href=\"javascript:targets(\'targets/1r.gif\')\"><font size=2 color=003300>4 Ring RED</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/3.gif\')\"><font size=2 color=003300>Large 5 ring Red</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/2.gif\')\"><font size=2 color=003300>6 Ring black</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/10ring.gif\')\"><font size=2 color=003300>10 Ring</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/10ringred.gif\')\"><font size=2 color=003300>10 Ring Red</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/4.gif\')\"><font size=2 color=003300>Green Cross Hairs</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/5.gif\')\"><font size=2 color=003300>Red Cross Hairs</font></a><br>")

document.write("<a href=\"javascript:targets(\'targets/6.gif\')\"><font size=2 color=003300>Window</font></a><br>")






document.write("</font></center>")

martin_narg
09-16-2005, 05:34 PM
Something like this:


<select name="selectTargets" onchange="if(this.selectedIndex > 0){targets(this.options[this.selectedIndex].value);}">
<option>Please select a value</option>
<option value="targets/1.gif">4 Ring Black</option>
<option value="targets/1r.gif">4 Ring RED</option>
<option value="targets/3.gif">Large 5 ring Red</option>
<option value="targets/2.gif">6 Ring black</option>
<option value="targets/10ring.gif">10 Ring</option>
<option value="targets/10ringred.gif">10 Ring Red</option>
<option value="targets/4.gif">Green Cross Hairs</option>
<option value="targets/5.gif">Red Cross Hairs</option>
<option value="targets/6.gif">Window</option>
</select>


Please note that the <font> tag is deprecated and shouldn't be used. Use CSS instead.

Hope this helps

m_n

claymaker
09-17-2005, 01:52 AM
:eek:

martin_narg
09-17-2005, 12:06 PM
didn't work? how? just copy and paste my previous code into your html page where you want it to appear. if you get any error messages, please post them.

m_n

claymaker
09-17-2005, 04:39 PM
what I'm tring to do is keep all the work in the js file and it seems the drop down box code works in the html but not the js file

martin_narg
09-17-2005, 05:07 PM
document.write('<select name="selectTargets" onchange="if(this.selectedIndex > 0){targets(this.options[this.selectedIndex].value);}">\
<option>Please select a value</option>\
<option value="targets/1.gif">4 Ring Black</option>\
<option value="targets/1r.gif">4 Ring RED</option>\
<option value="targets/3.gif">Large 5 ring Red</option>\
<option value="targets/2.gif">6 Ring black</option>\
<option value="targets/10ring.gif">10 Ring</option>\
<option value="targets/10ringred.gif">10 Ring Red</option>\
<option value="targets/4.gif">Green Cross Hairs</option>\
<option value="targets/5.gif">Red Cross Hairs</option>\
<option value="targets/6.gif">Window</option>\
</select>');

m_n

claymaker
09-17-2005, 08:31 PM
Is there a way to force a return to (Please select a value) in the menu box at the same time maintain the selected option on the screen after an option is selected

martin_narg
09-18-2005, 12:44 AM
document.write('<select name="selectTargets" onchange="if(this.selectedIndex > 0){targets(this.options[this.selectedIndex].value);this.selectedIndex=0; }">\
<option>Please select a value</option>\
<option value="targets/1.gif">4 Ring Black</option>\
<option value="targets/1r.gif">4 Ring RED</option>\
<option value="targets/3.gif">Large 5 ring Red</option>\
<option value="targets/2.gif">6 Ring black</option>\
<option value="targets/10ring.gif">10 Ring</option>\
<option value="targets/10ringred.gif">10 Ring Red</option>\
<option value="targets/4.gif">Green Cross Hairs</option>\
<option value="targets/5.gif">Red Cross Hairs</option>\
<option value="targets/6.gif">Window</option>\
</select>');



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum