Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - re-populate formfield when user hits back
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

re-populate formfield when user hits back

 Post Reply Post Reply Page  12>
Author
dizzyfunk View Drop Down
Newbie
Newbie


Joined: 12 September 2003
Location: United Kingdom
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dizzyfunk Quote  Post ReplyReply Direct Link To This Post Topic: re-populate formfield when user hits back
    Posted: 13 September 2003 at 4:23am

i have a BIG for that send to an asp process page which checks validation on formfields.

if formfields incorrect then the page redirects back to the form page with an error message.

how can i get the form to re-populate itself with the data that was entered to it?

i can't use the GET method for the form as it creates a querystring more than 255 characters!!

HELP!

Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2003 at 8:22am

on the validation page, store each value in a variable using

strVar1 = Request.Form("input1")
strVar2 = Request.Form("input2")

and so on... then in the code that redirects back to the form use a querystring

Response.Redirect ("form.asp?input1=strVar1&input2=strVar2")

back on the form page you have to store the valus into a variable again using

input1 = Request.QueryString("input1")
input2 = Request.QueryString("input2")

Then in the form you have to use the variables in the value fields

<input type="text" name="input1" value="<%=input1%>">

__________________________________________________________

That's one way to do it.

Back to Top
dizzyfunk View Drop Down
Newbie
Newbie


Joined: 12 September 2003
Location: United Kingdom
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dizzyfunk Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2003 at 8:32am

will this work if the querystring is about 4 miles long?

 

Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2003 at 12:45pm
I don't see why not... that's the easiest solution unless you want to use a database.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2003 at 2:00pm
Originally posted by dizzyfunk dizzyfunk wrote:

will this work if the querystring is about 4 miles long?


 



No.
The querystring can only store a limited amount of data.
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2003 at 2:27pm

I guess for IE 5&6 the limit is 2,048 characters, but if you need more than that you might use a db.

Back to Top
dizzyfunk View Drop Down
Newbie
Newbie


Joined: 12 September 2003
Location: United Kingdom
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dizzyfunk Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2003 at 3:09am

it's cool... in my amateurish way of trying to be all clever with ASP..

 

i totally forgot about validating the form using javascript on the form page itself!!

 

many thanks for the replies!



Edited by dizzyfunk
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2003 at 9:07am

I'm actually about to do the same thing myself over the weekend. I've only got one textarea though, and I'm going to be using it for users to change things - i.e. Go back on a user action.

I'm planning on using a button to POST back to the previous page. I won't actually need hidden fields because I'll use a component to HEAD everything back to the original page. That way I'll scoot around GET, which is poor, and I'll also get around having to use hidden fields.

I'll try to post some of it back later when I've got it done.

BTW: you can also do automatic redirection the way I'm planning, but I'll post it later when it's done.

 

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.