form handling; URL generation 
Author Message
 form handling; URL generation

How can I get parameters from the form and concatenate them to the URL
in the action field?

for example,  I have a form with just a text field named TXT and a
submit button. after entering the string hello into the text field, the
user submits the form, yielding to go to the URL:
http://www.*-*-*.com/

Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 form handling; URL generation

You could do this with JavaScript.
Explaining how to write JavaScript is beyond the scope of this
group. Check out WebMonkey.com, MSDN Library or one of another
million JavaScript tutorial sites.

However, you may want to consider why you're trying to do this.
Why do you need form variables in the URL querystring?

Why not just access it from the Request.Form object?

-Chad

Quote:

> How can I get parameters from the form and concatenate them to the URL
> in the action field?

> for example,  I have a form with just a text field named TXT and a
> submit button. after entering the string hello into the text field, the
> user submits the form, yielding to go to the URL:
> http://mySite.com/myProg?TXT=hello

> Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 form handling; URL generation
The GET method (as in <form ... method="GET" action="some.asp">) does that for you automatically...

--
Michael Harris
MVP Scripting

How can I get parameters from the form and concatenate them to the URL
in the action field?

for example,  I have a form with just a text field named TXT and a
submit button. after entering the string hello into the text field, the
user submits the form, yielding to go to the URL:
http://mySite.com/myProg?TXT=hello

Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 form handling; URL generation

myProg would me an asp with another VBScript running on the server side. t
hat script would take parameters entered by the user in the form by using:
txt = Request.QueryString("TXT")
How to use Request.Form object? in the server-side script?
What would be the simpliest way to do this.

Thanks,
Michael

Quote:

> You could do this with JavaScript.
> Explaining how to write JavaScript is beyond the scope of this
> group. Check out WebMonkey.com, MSDN Library or one of another
> million JavaScript tutorial sites.

> However, you may want to consider why you're trying to do this.
> Why do you need form variables in the URL querystring?

> Why not just access it from the Request.Form object?

> -Chad


> > How can I get parameters from the form and concatenate them to the URL
> > in the action field?

> > for example,  I have a form with just a text field named TXT and a
> > submit button. after entering the string hello into the text field, the
> > user submits the form, yielding to go to the URL:
> > http://mySite.com/myProg?TXT=hello

> > Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 form handling; URL generation

Unfortunately, I have to use the POST method because I'm also uploading a file. if I use the GET
method, the parameters are passed correctly but the uploading doesn't work.

thanks,
Michael

Quote:

> The GET method (as in <form ... method="GET" action="some.asp">) does that for you automatically...

> --
> Michael Harris
> MVP Scripting


> How can I get parameters from the form and concatenate them to the URL
> in the action field?

> for example,  I have a form with just a text field named TXT and a
> submit button. after entering the string hello into the text field, the
> user submits the form, yielding to go to the URL:
> http://mySite.com/myProg?TXT=hello

> Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 form handling; URL generation
When you submit a form to an ASP page, the Request.Form object is
populated will all the form input files.

If you have <INPUT NAME=txt1> in your HTML and it posts to an ASP page,
you can access the data that was entered into this field by using this in
your VBScript on your ASP page:

'---------------------------
Dim myVar

myVar = Request.Form("txt1")

'do something with myVar
'---------------------------

This is how you process forms in ASP.

I suggest you get a book on ASP and learn the basics. Using the Response
and Request objects are the basic fundamentals of ASP.

-Chad

Quote:

> myProg would me an asp with another VBScript running on the server side. t
> hat script would take parameters entered by the user in the form by using:
> txt = Request.QueryString("TXT")
> How to use Request.Form object? in the server-side script?
> What would be the simpliest way to do this.

> Thanks,
> Michael


> > You could do this with JavaScript.
> > Explaining how to write JavaScript is beyond the scope of this
> > group. Check out WebMonkey.com, MSDN Library or one of another
> > million JavaScript tutorial sites.

> > However, you may want to consider why you're trying to do this.
> > Why do you need form variables in the URL querystring?

> > Why not just access it from the Request.Form object?

> > -Chad




- Show quoted text -

Quote:
> > > How can I get parameters from the form and concatenate them to the URL
> > > in the action field?

> > > for example,  I have a form with just a text field named TXT and a
> > > submit button. after entering the string hello into the text field, the
> > > user submits the form, yielding to go to the URL:
> > > http://mySite.com/myProg?TXT=hello

> > > Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 form handling; URL generation
In order to use file uploads (e.g. <INPUT TYPE="file"...) you must have the
MS Posting Acceptor 1.2 loaded on your server.

This is available on the NT OptionPack CD.

-Chad

Quote:

> Unfortunately, I have to use the POST method because I'm also uploading a

file. if I use the GET
Quote:
> method, the parameters are passed correctly but the uploading doesn't work.

> thanks,
> Michael


> > The GET method (as in <form ... method="GET" action="some.asp">) does that

for you automatically...
Quote:

> > --
> > Michael Harris
> > MVP Scripting




Quote:
> > How can I get parameters from the form and concatenate them to the URL
> > in the action field?

> > for example,  I have a form with just a text field named TXT and a
> > submit button. after entering the string hello into the text field, the
> > user submits the form, yielding to go to the URL:
> > http://mySite.com/myProg?TXT=hello

> > Thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. url generation, is regex the only answer?

2. Automatic form generation form access

3. Invalid URL form or fully-qualified absolute URL was used

4. passing fields from form to form, and handling a date field

5. Postscript Form generation?

6. url handling

7. error handling for different kinds of errors related to the URL

8. ActiveX documents and URL handling...

9. run-time forms generation

10. Dynamic form generation

11. More Powerful Forms Generation Software

12. Simple question about Form generation

 

 
Powered by phpBB® Forum Software