Skip to main content
Inspiring
June 16, 2006
Question

retaining one forms entered values, whilst page refreshes?

  • June 16, 2006
  • 4 replies
  • 300 views
I'm using ASP/VBScript.

I have two forms, side by side on a page.
The form on the left is completed by the user. The form on the right is
populated from a drop down menu selection made by the user. When the
selection is made, the page submits to itself, which populates the right
hand form.
However, when this happens, the contents of the left form have been wiped.

How do I prevent that happening? Will I have to set some form of temporary
cookie to retain the left form's values?
Much appreciated.
Nath


This topic has been closed for replies.

4 replies

Inspiring
June 19, 2006
Hi,

Thanks for getting back in touch. Whilst there are 4 forms on the page
(when editing) the reality is that, client-side, they'll only ever see two.
On the left, if they haven't chosen a previously used address from the drop
down menu, they see a blank form - same on the right.

If they choose someone from the drop down menu on the left, the blank left
form is replaced by another form which has database values as its initial
values. Same on the right, but when the page refreshes on the right, the
left values are gone.

I'll have a look at remote scripting and, if stuck, will no doubt be back!

Much appreciated
Regards
nath.

"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:e76coh$n5$1@forums.macromedia.com...
> Four forms does make things messier, because whichever of the four forms
> is submitted needs to hold ALL the values necessary to maintain state on
> the other three forms. If they're used in order (and always in order),
> that means that the second form holds all its values plus hidden fields
> for the first; the third has all its values and hidden fields for the
> first and second, and so on and so forth. If they're used in any order,
> then all four forms must have all fields necessary for all the forms on
> the page, with the ones not currently applicable as hidden fields.
>
> It's going to be a big leap, but you might want to consider remote
> scripting here instead:
> http://developer.apple.com/internet/webcontent/iframe.html
>
> That will mitigate the need for maintaining state on the forms. Don't be
> put off by the title - the IFRAME isn't visible on your page and holds no
> content for the user. It's just a convenient way to call a processing
> page without the visitor leaving your form page . If I was a trendy
> person, I'd call this "AJAX", but I despise fads. ;)
> Besides, this technique has been around forever.
>
> I use the IFRAME because it has slightly wider support than the
> client-side XMLHTTP object that would typically be used in this case. If
> you don't need to support older browsers (IE4, Opera 7, etc), then it's
> your choice.
>
>
>
> "Nathon Jones" <sales@NOSHPAMtradmusic.com> wrote in message
> news:e718hh$t22$1@forums.macromedia.com...
>> Is this perhaps something to do with the fact that the drop down menus
>> are separate forms to the main address areas? In effect, the main
>> address areas are not being submitted when the option is selected from
>> either drop down menu. I need to know how to retain the values in one
>> form, whilst the drop down menu in another form refreshes the page.
>>
>> Hope you can help,
>> Much appreciated.
>> Nath.
>
>


Inspiring
June 19, 2006
Four forms does make things messier, because whichever of the four forms is
submitted needs to hold ALL the values necessary to maintain state on the
other three forms. If they're used in order (and always in order), that
means that the second form holds all its values plus hidden fields for the
first; the third has all its values and hidden fields for the first and
second, and so on and so forth. If they're used in any order, then all four
forms must have all fields necessary for all the forms on the page, with the
ones not currently applicable as hidden fields.

It's going to be a big leap, but you might want to consider remote scripting
here instead:
http://developer.apple.com/internet/webcontent/iframe.html

That will mitigate the need for maintaining state on the forms. Don't be
put off by the title - the IFRAME isn't visible on your page and holds no
content for the user. It's just a convenient way to call a processing page
without the visitor leaving your form page . If I was a trendy person, I'd
call this "AJAX", but I despise fads. ;)
Besides, this technique has been around forever.

I use the IFRAME because it has slightly wider support than the client-side
XMLHTTP object that would typically be used in this case. If you don't need
to support older browsers (IE4, Opera 7, etc), then it's your choice.



"Nathon Jones" <sales@NOSHPAMtradmusic.com> wrote in message
news:e718hh$t22$1@forums.macromedia.com...
> Is this perhaps something to do with the fact that the drop down menus are
> separate forms to the main address areas? In effect, the main address
> areas are not being submitted when the option is selected from either drop
> down menu. I need to know how to retain the values in one form, whilst
> the drop down menu in another form refreshes the page.
>
> Hope you can help,
> Much appreciated.
> Nath.


Inspiring
June 17, 2006
Thanks Lionstone. What if the left hand form is also populated by a dynamic
form?
I have 4 forms, in total, on the page.

On the left I have a drop down menu, separate to the main form, which is for
selecting previously used addresses from the customers order history.

Below that, a blank form, should the user be entering a new address.
The blank form is in a Show If Empty area. If the user hasn't selected
something from the drop down, the blank form is displayed.

If the user does select from the drop down, the page refreshes and it
displays an autofilled form which is in a Show If Not Empty area. The
fields are populated with the data from the recordset, subject to the choice
the user has made from the drop down. That all works great.

On the right, same thing, a drop down menu, that refreshes to the same page,
to allow a user to select a previously used address. If they don't choose
one, a blank form is displayed (again, in a Show If Empty). If they do
choose one, the page refreshes and autofills the form which is in a Show If
Not Empty....which basically has the effect, on Refresh, of wiping all of
the contents of the left hand form. And that's my problem.

So, I took your advice, and set the initial values in the left form to equal
themselves but the information is still disappearing.

Is this perhaps something to do with the fact that the drop down menus are
separate forms to the main address areas? In effect, the main address areas
are not being submitted when the option is selected from either drop down
menu. I need to know how to retain the values in one form, whilst the drop
down menu in another form refreshes the page.

Hope you can help,
Much appreciated.
Nath.

"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:e6ukso$rbc$1@forums.macromedia.com...
> Set the initial values in the left form equal to themselves. That is,
> <input name="someField" type="text"
> value="<%=Request.Form("someField")%>">
> <input name="someCheckbox" type="checkbox" value="1" <%If
> Request.Form("someCheckbox") = "1" Then Response.Write("checked") End
> If%>>
>
> et cetera
>
> "Nathon Jones" <sales@NOSHPAMtradmusic.com> wrote in message
> news:e6u4dq$792$1@forums.macromedia.com...
>> I'm using ASP/VBScript.
>> How do I prevent that happening? Will I have to set some form of
>> temporary cookie to retain the left form's values?
>> Much appreciated.
>> Nath
>>
>
>


Inspiring
June 16, 2006
Set the initial values in the left form equal to themselves. That is,
<input name="someField" type="text" value="<%=Request.Form("someField")%>">
<input name="someCheckbox" type="checkbox" value="1" <%If
Request.Form("someCheckbox") = "1" Then Response.Write("checked") End If%>>

et cetera

"Nathon Jones" <sales@NOSHPAMtradmusic.com> wrote in message
news:e6u4dq$792$1@forums.macromedia.com...
> I'm using ASP/VBScript.
> How do I prevent that happening? Will I have to set some form of
> temporary cookie to retain the left form's values?
> Much appreciated.
> Nath
>