Skip to main content
Inspiring
February 21, 2007
Question

retaining form field data in conjunction with Check Username behaviour?

  • February 21, 2007
  • 15 replies
  • 855 views
I have a customer registration form. It asks the customer to enter a
username. I have the Check Username behaviour on this form page, along with
the Insert behaviour of course.

If the Username already exists in the database, I am just re-directing to
the same registration form/page however the other fields are wiped after the
re-direct.

How can I retain the data entered in all of these fields so that the
customer only has to enter a new username?

Thanks.
nath.


This topic has been closed for replies.

15 replies

Inspiring
February 21, 2007
The built-in behaviors might only work with a POST form. It's been a while
since I've used them. So scratch that.

In your case, it's the check new username redirect that you need to preserve
the values. In that behavior, you'll see a line that says
Response.Redirect(something). That something might be a variable such as
MM_redirectURL, or it might be the actual page URL "myForm.asp" or
something. In either case, just add the entire form to the URL:
Response.Redirect(someVariable & "&" & Request.Form)
or
Response.Redirect("somePage.asp?" & Request.Form)

If I recall, the check new username redirect URL already has "badusername"
added to the query string, that's why I appended "&" in the first example.
If that's different now, then simply use "?" as normal to start the query
string part of the URL.


"tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in message
news:erhic5$4n7$1@forums.macromedia.com...
> Hi again Lionstone. I notice a couple of requests for this feature, so
> hopefully this will help a few out.
> At the moment, the form is:
> <form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
>
> So, I've changed the method to "GET" but I'm now getting this when I
> submit the form:
> Microsoft JET Database Engine error '80040e10'
> Parameter ?_1 has no default value.
>
> Parameter 1 is:
> MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1,
> 50, Request.Form("firstname")) ' adVarWChar
>
> Is there something else I need to change other than the Method?
> Could you also explain, in a little more detail, how to add the entered
> form values to the redirect part of the behaviour? Which behaviour? The
> Check Username or the Insert Record?
>
> Hope you can help.
>
> Thanks.
> Nath.
>
>
> "Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
> news:erhgrm$321$1@forums.macromedia.com...
>> You have a few options. You can change the form to GET and treat it like
>> a query string. The check new username behavior will preserve the query
>> string. You can also find the redirect part of the behavior and
>> explicitly add the form collection as a query string
>> (Response.Redirect(myURL & Request.Form). The form's default values can
>> then be set to the matching query string value. If the check new
>> username behavior and the actual insert behavior are on a different page
>> than the form, you can also just change response.redirect to
>> server.transfer, and the form will then be available on the registration
>> page.
>>
>>
>> "tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in message
>> news:erhb9i$pmb$1@forums.macromedia.com...
>>>I have a customer registration form. It asks the customer to enter a
>>>username. I have the Check Username behaviour on this form page, along
>>>with the Insert behaviour of course.
>>>
>>> If the Username already exists in the database, I am just re-directing
>>> to the same registration form/page however the other fields are wiped
>>> after the re-direct.
>>>
>>> How can I retain the data entered in all of these fields so that the
>>> customer only has to enter a new username?
>>>
>>> Thanks.
>>> nath.
>>>
>>
>>
>
>


Inspiring
February 21, 2007
Hi Envision.

I have tried entering request.form("formField") as the default value for
each of the form fields, but when the page re-directs (to itself - only if
the username already exists in the database table) the fields are blank.
Here's an example field:

<input name="firstname" type="text" id="firstname" accesskey="3"
tabindex="3" value="<%= Request.Form("firstname") %>" size="20"
maxlength="30">

My form method is set to POST and when I set it to GET I receive a missing
parameter error.

Has really got me stumped I must admit because I was sure that, because the
form was posting to itself, that I would be able to re-use the form field
data.
Any other ideas?

Much appreciated
Nath.

"envision3d" <webforumsuser@macromedia.com> wrote in message
news:erhr8f$f6s$1@forums.macromedia.com...
> you could try using the request.form("formField") to retain the values


Inspiring
February 21, 2007
you could try using the request.form("formField") to retain the values
Inspiring
February 21, 2007
Hi again Lionstone. I notice a couple of requests for this feature, so
hopefully this will help a few out.
At the moment, the form is:
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">

So, I've changed the method to "GET" but I'm now getting this when I submit
the form:
Microsoft JET Database Engine error '80040e10'
Parameter ?_1 has no default value.

Parameter 1 is:
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1,
50, Request.Form("firstname")) ' adVarWChar

Is there something else I need to change other than the Method?
Could you also explain, in a little more detail, how to add the entered form
values to the redirect part of the behaviour? Which behaviour? The Check
Username or the Insert Record?

Hope you can help.

Thanks.
Nath.


"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:erhgrm$321$1@forums.macromedia.com...
> You have a few options. You can change the form to GET and treat it like
> a query string. The check new username behavior will preserve the query
> string. You can also find the redirect part of the behavior and
> explicitly add the form collection as a query string
> (Response.Redirect(myURL & Request.Form). The form's default values can
> then be set to the matching query string value. If the check new username
> behavior and the actual insert behavior are on a different page than the
> form, you can also just change response.redirect to server.transfer, and
> the form will then be available on the registration page.
>
>
> "tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in message
> news:erhb9i$pmb$1@forums.macromedia.com...
>>I have a customer registration form. It asks the customer to enter a
>>username. I have the Check Username behaviour on this form page, along
>>with the Insert behaviour of course.
>>
>> If the Username already exists in the database, I am just re-directing to
>> the same registration form/page however the other fields are wiped after
>> the re-direct.
>>
>> How can I retain the data entered in all of these fields so that the
>> customer only has to enter a new username?
>>
>> Thanks.
>> nath.
>>
>
>


Inspiring
February 21, 2007
You have a few options. You can change the form to GET and treat it like a
query string. The check new username behavior will preserve the query
string. You can also find the redirect part of the behavior and explicitly
add the form collection as a query string (Response.Redirect(myURL &
Request.Form). The form's default values can then be set to the matching
query string value. If the check new username behavior and the actual
insert behavior are on a different page than the form, you can also just
change response.redirect to server.transfer, and the form will then be
available on the registration page.


"tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in message
news:erhb9i$pmb$1@forums.macromedia.com...
>I have a customer registration form. It asks the customer to enter a
>username. I have the Check Username behaviour on this form page, along
>with the Insert behaviour of course.
>
> If the Username already exists in the database, I am just re-directing to
> the same registration form/page however the other fields are wiped after
> the re-direct.
>
> How can I retain the data entered in all of these fields so that the
> customer only has to enter a new username?
>
> Thanks.
> nath.
>