![]() Preserved Topic: javascript: two variables in value-tag (Page 1 of 1) |
|
---|---|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() ok, i got a <SELECT> with a lot of <OPTION VALUE=... NAME=...> which are dynamically generated by php. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
![]() The poster has demanded we remove all his contributions, less he takes legal action. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() You could also do something like have the php output a javascript array of corresponding values that you can index |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() ini, that's a nice idea, but it wont work since one of the values is an url. and it already contains : and i dont wanna program a text parser that filters all that out. |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() uhhhh i just found a very elegant solution myself: code: <INPUT type="button" value="Insert Linkcode" onClick="addText(document.editmenu.links.value,document.editmenu.links.options[document.editmenu.links.selectedIndex].text)">
|
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() Hi. code: <html> |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() now that is really interesting! i didnt know that. thanks! |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() This is an interesting method, but keep in mind that it's a hack, and not the way style sheets are intended to be used. I mean, it should always work, but it's not really *morally* right to use it. =) |
Bipolar (III) Inmate From: USA! USA! USA! |
![]() You could also write script to add "value2" properties to the options when the page loads. The DOM supports getAttribute also, which is the best method if you can stick to the right browsers. |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() the problem is, i cant. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() I wish you'd say what you're trying to do, but try making two arrays, where the first element in each array corresponds to the first option in the list, and so on. then, when someone selects an option, read from the arrays. |