Kenny Pollock
Jul 5 2005, 04:03 PM
I'm using
CODE
print "\t\t\t<option value=\"".$entry."\" label=\"".str_replace("\t\t", "", $tree['HOUSTONCAT']['CATNAME']['VALUE'])."\">".$tree['HOUSTONCAT']['CATDESC']['VALUE'] ."</option>\n";
I know how to get value of an option, and label, but what's in between the option tags? I thought it was .text but that shows the value too.
Thanks!
.Jack
Jul 5 2005, 04:06 PM
HTML
<option value="HIDDENVALUE">SHOWNTEXT</option>
Kenny Pollock
Jul 5 2005, 04:08 PM
Uh? What is that for? I asked what is it called in JS between the option tags?
EX:
LABEL: this.options[this.selectedIndex].label
VALUE: this.options[this.selectedIndex].value
(and also this.options[this.selectedIndex].text I've learned)
<OPTION>this</OPTION>: ??
Stephen
Jul 5 2005, 04:11 PM
it should be .text and .value is the value="" attribute maybe it doesn't work because you have the label attribute? I just tested the label attribute in the major 3 browsers and none of them use it
Kenny Pollock
Jul 5 2005, 04:13 PM
That's the thing, I want to have 3 attributes to it.
Value is set to the filename of the file it's showing, label is set to what I want to show, and what's in between the two tags is the description of the file, all three which I need.
Stephen
Jul 5 2005, 04:18 PM
Well that seems weird but anyway, what error does the JS give you?
Kenny Pollock
Jul 5 2005, 04:25 PM
No error, but .text shows the value and not the text inbetween. I want it to show the text in between.
Nash12
Jul 7 2005, 10:22 AM
I set up an example, I hope that is what you mean:
http://www.nashweb.de/test/select.htmlSelect an option of the select box and an alert will popup containing the text between selected the option tag. I just tested in in Firefox; itīs done via:
CODE
this.options[this.selectedIndex].firstChild.nodeValue
.innerHTML?
Kenny Pollock
Jul 7 2005, 08:20 PM
DUDE! Thanks Veracon (as usual).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.