How not to reset the value...

Results 1 to 2 of 2

Thread: How not to reset the value...

  1. #1
    Join Date
    Dec 1969

    Default How not to reset the value...

    When I'm using Selection boxes (don't know the name for sure) and use them in combination with a submit button, everything works out just fine and I get the correct value. However, the value in the selection-box itself, always reset to the original value. I'm very new to this and would like an answer. Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: How not to reset the value...

    That behavior is by design. There is an option you can put that that will select one value called &#039;selected&#039;, but this would make it default to a value just that you determin which one by default.<BR><BR>Basically a select box when loaded will look for any &#060;option&#062; tags that have a &#060;option value="this" selected&#062; value. If none are found it goes to the first element. There is no HTML way around this, since HTML is a formatting language.<BR><BR>If for example say I picked &#039;BMW&#039; from a select box that had many types of cars. The next time I come back, I will have to do it all over again. If you wanted the form to automatically change to &#039;BMW&#039; next time I come back then you will need to have some logic for that select box. You can do this a number of ways and specific to this web site and material, I would choose ASP or Javascript. Javascript is probably more to your liking since you can find code samples everywhere and it will prevent you from having to set up a server for ASP. If the server is .asp ready then search for asp samples with selcet boxes and you will find many variations of what you want.<BR> There are many ways, to do this, frames and hidden variables, querystrings, cookies, databases, asp sessions and so forth.<BR><BR>Could you provide a bit more of a walk though on what you want your site to do. (IE. User is on page1, selects a few things, on page 2 more options are selected and one select box should have the value from the previous page.) This would help pinpoint a good solution for your project.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts