Retaining the value of form objects and defined va

Results 1 to 3 of 3

Thread: Retaining the value of form objects and defined va

  1. #1
    Join Date
    Dec 1969
    Posts
    52

    Default Retaining the value of form objects and defined va

    I have a form with several objects (listboxes, checkboxes, text fields) and the page submits to itself, each time using the entered values in the objects to filter a recordset, display the number of matching records and asking for more entries to narrow down the list. What I can&#039t do is retain the values entered so far, so that in one multi-select list box values 2,3 and 5 may be selected, but when I submit the form and it reloads, the list box is clear again, so that the user doesn&#039t know what items were selected first time. Is there a way of recalling the values selected in mult-select list boxes (and radio buttons, text boxes and check boxes!).<BR><BR>I also have several variables I&#039ve designed that I want to retain as I reload the page. I&#039ve heard that session variables are bad news, so is there any other way?<BR><BR>Thanks for any help

  2. #2
    Vivek Nama Guest

    Default Retaining the value of form objects and defined va

    Use &#060;INPUT type=hidden ....&#062; on your page<BR>concatenate all the values that you want appearing on the subsequent visit to the page in one string lets say "var1=&#039ANNE&#039+text1=&#039sometext&#039+sele ctedindexinlistbox=2#3#5" and assign it to the hidden &#060;INPUT ...&#062; so that the values pass to the refreshed page in the form/querystring collection<BR>on the window.onload provide a function to parse the value available to pre-set the page as desired

  3. #3
    Carl Edwards Guest

    Default RE: Retaining the value of form objects and define

    Thanks for replying Vivek, however I&#039m a bit new at this and you&#039ve highlighted my main problem in your answer. In the &#039selectedindexinlistbox&#039 property - you have the values 2, 3 & 5 - but how do I get at these values? All the references I&#039ve seen have referred to things like &#039document.Form.fieldname.selectedindex&#039 and this makes no sense to me at all when I&#039m trying to use: <BR>&#039request("fieldname").selectedindex&#039 (although I realise that &#039selectedindex&#039 won&#039t help anyway because it only shows the first selected item and I want all of them).<BR><BR>Is it the &#039selected&#039 property I need, and in that case is the syntax:<BR>&#039request("fieldname")(array).select ed&#039 ? to return true or false?<BR><BR>I&#039m lost - any more help would be greatly appreciated!

Posting Permissions

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