select box, selectedIndex problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adam

    #1

    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">000 1</option> <option
    Value="605">000 2</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!
  • lallous

    #2
    Re: select box, selectedIndex problems

    Perhaps this link inspires you:



    --
    Elias
    "Adam" <shaggy_a79@yah oo.com> wrote in message
    news:88247884.0 312300556.3c390 b@posting.googl e.com...[color=blue]
    > 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">000 1</option> <option
    > Value="605">000 2</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![/color]


    Comment

    • Adam

      #3
      Re: select box, selectedIndex problems

      WOW. Thats all I can say. Thats a really cool example. I think that
      will help a lot.
      Thanks much!
      Adam

      "lallous" <lallous@lgwm.o rg> wrote in message news:<bss2qr$rs ag$1@ID-161723.news.uni-berlin.de>...[color=blue]
      > Perhaps this link inspires you:
      >
      > http://lgwm.org/ozone/dynatable.htm
      >
      > --
      > Elias
      > "Adam" <shaggy_a79@yah oo.com> wrote in message
      > news:88247884.0 312300556.3c390 b@posting.googl e.com...[color=green]
      > > 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">000 1</option> <option
      > > Value="605">000 2</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![/color][/color]

      Comment

      Working...