S
SGershon
Hi!
Since the first questions I asked here, I continue to drop by and read
some topics here and there, I like the replies very much.
I have today another question, I don't seem to find it on the FAQ
(please point me if its there):
I have two selects, one written 'directly on the page' and a second
written dinamically by JavaScript. (Actually, both are written by php
using data from a DB).
One is dependable of the other, and I am using the code of DevArticles
to make them depend:
http://tinyurl.com/df6vf
The Question: Now, I want to select the selected option of both inputs,
after the page is loaded.
How can I make the right option selected, based on the value of it?
I know the id and the value of each <OPTION>, but I do not know the
position of the <OPTION> inside the <SELECT>. So I guess I can not use
something like document.form.selectinput.options[1].selected, unless I
iterate through all the options. If this is the way to do it, how is
the iteration to be done?
I hope you can help me on this, and thank you for all the times you
helped me on the past!
SGershon
Since the first questions I asked here, I continue to drop by and read
some topics here and there, I like the replies very much.
I have today another question, I don't seem to find it on the FAQ
(please point me if its there):
I have two selects, one written 'directly on the page' and a second
written dinamically by JavaScript. (Actually, both are written by php
using data from a DB).
One is dependable of the other, and I am using the code of DevArticles
to make them depend:
http://tinyurl.com/df6vf
The Question: Now, I want to select the selected option of both inputs,
after the page is loaded.
How can I make the right option selected, based on the value of it?
I know the id and the value of each <OPTION>, but I do not know the
position of the <OPTION> inside the <SELECT>. So I guess I can not use
something like document.form.selectinput.options[1].selected, unless I
iterate through all the options. If this is the way to do it, how is
the iteration to be done?
I hope you can help me on this, and thank you for all the times you
helped me on the past!
SGershon