Request.Form equivalent in client side javascript?

  • Follow


Hi all,

I have a potentially simple question...

I need to keep the value of a field between form posts?
I was thinking of using the equivalent of Request.Form("Field1") in
javascript to set the value of the field on the body onload event? is
this possible in javascript?
Is there are simple way to do this? 

Any help would be appreciated.

Thanks in advance.

Sergio.
0
Reply sergio 7/14/2004 11:50:41 AM


Sergio Otoya wrote:

> I need to keep the value of a field between form posts?
> I was thinking of using the equivalent of Request.Form("Field1") in
> javascript to set the value of the field on the body onload event? is
> this possible in javascript?

You cannot post to a static HTML page so there should be some 
server-side page processing your post data which could then create the 
script for the client with the right objects.
Client-side JavaScript on the receiving page itself has no access to 
post data.
With the GET method you can read out and parse
   location.search

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/

0
Reply Martin 7/14/2004 1:09:56 PM


In article <3392f577.0407140350.62f85af@posting.google.com>, 
sergio@winapp.com.au enlightened us with...
> 
> I need to keep the value of a field between form posts?
> I was thinking of using the equivalent of Request.Form("Field1") in
> javascript to set the value of the field on the body onload event? is
> this possible in javascript?

There is no equivalent to Request.Form in client-side javascript.

> Is there are simple way to do this? 

Sure. Use the URL. Use GET to pass the form, then parse the URL to get 
the value(s) as needed.
 
http://www.ipwebdesign.net/kaelisSpace/useful_parseUrl.html

-- 
--
~kaeli~
Suicide is the most sincere form of self-criticism. 
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

0
Reply kaeli 7/14/2004 2:02:27 PM

2 Replies
312 Views

(page loaded in 0.044 seconds)

Similiar Articles:













7/25/2012 11:06:54 PM


Reply: