470,618 Members | 1,698 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,618 developers. It's quick & easy.

select box, selectedIndex problems

OK. Here goes...

I have a page in IE 6 that has a row with some input boxes and one
SELECT box. Below this row there is a button that onClick, it adds a
new row to the page dynamically. What it does actually is rewrites
those inputs and SELECTS on the page by first putting them in arrays
and then after writing the boxes, it puts them back where they go.
OK? OK.

So this SELECT box is my problem. The string that defines it, is
written from ASP on page load. It works no problem. Until you add a
row to the page. When a user has already chose a option there, and
then clicks ADD, it resets thier SELECT box to the first option, not
what they chose. I cannot figure out how to find thier choice and
keep it selected. The value of the option corresponds to the number
in the DB... but I can't very well look that up from the DB while the
page is running...

<option Value="231">0001</option> <option
Value="605">0002</option>...etc.

I need to somehow, I guess to retrive the selectedIndex from the
SELECT box, but I have been unsuccessful. I have also tried to put
the index value in a hidden box but also unsuccessfully. That is the
only ideas I have had, and they have not worked for me. Can anyone at
least point me in the right direction?

Thanks in advance!
Jul 20 '05 #1
2 1624
Perhaps this link inspires you:

http://lgwm.org/ozone/dynatable.htm

--
Elias
"Adam" <sh********@yahoo.com> wrote in message
news:88************************@posting.google.com ...
OK. Here goes...

I have a page in IE 6 that has a row with some input boxes and one
SELECT box. Below this row there is a button that onClick, it adds a
new row to the page dynamically. What it does actually is rewrites
those inputs and SELECTS on the page by first putting them in arrays
and then after writing the boxes, it puts them back where they go.
OK? OK.

So this SELECT box is my problem. The string that defines it, is
written from ASP on page load. It works no problem. Until you add a
row to the page. When a user has already chose a option there, and
then clicks ADD, it resets thier SELECT box to the first option, not
what they chose. I cannot figure out how to find thier choice and
keep it selected. The value of the option corresponds to the number
in the DB... but I can't very well look that up from the DB while the
page is running...

<option Value="231">0001</option> <option
Value="605">0002</option>...etc.

I need to somehow, I guess to retrive the selectedIndex from the
SELECT box, but I have been unsuccessful. I have also tried to put
the index value in a hidden box but also unsuccessfully. That is the
only ideas I have had, and they have not worked for me. Can anyone at
least point me in the right direction?

Thanks in advance!

Jul 20 '05 #2
WOW. Thats all I can say. Thats a really cool example. I think that
will help a lot.
Thanks much!
Adam

"lallous" <la*****@lgwm.org> wrote in message news:<bs***********@ID-161723.news.uni-berlin.de>...
Perhaps this link inspires you:

http://lgwm.org/ozone/dynatable.htm

--
Elias
"Adam" <sh********@yahoo.com> wrote in message
news:88************************@posting.google.com ...
OK. Here goes...

I have a page in IE 6 that has a row with some input boxes and one
SELECT box. Below this row there is a button that onClick, it adds a
new row to the page dynamically. What it does actually is rewrites
those inputs and SELECTS on the page by first putting them in arrays
and then after writing the boxes, it puts them back where they go.
OK? OK.

So this SELECT box is my problem. The string that defines it, is
written from ASP on page load. It works no problem. Until you add a
row to the page. When a user has already chose a option there, and
then clicks ADD, it resets thier SELECT box to the first option, not
what they chose. I cannot figure out how to find thier choice and
keep it selected. The value of the option corresponds to the number
in the DB... but I can't very well look that up from the DB while the
page is running...

<option Value="231">0001</option> <option
Value="605">0002</option>...etc.

I need to somehow, I guess to retrive the selectedIndex from the
SELECT box, but I have been unsuccessful. I have also tried to put
the index value in a hidden box but also unsuccessfully. That is the
only ideas I have had, and they have not worked for me. Can anyone at
least point me in the right direction?

Thanks in advance!

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Simon Finn | last post: by
1 post views Thread by Jeff Thies | last post: by
3 posts views Thread by Dennis M. Marks | last post: by
4 posts views Thread by headware | last post: by
15 posts views Thread by TJ Walls | last post: by
2 posts views Thread by jascraig | last post: by
11 posts views Thread by Stefan Finzel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.