Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending something to URL

Status
Not open for further replies.

ITGL72

MIS
Jul 2, 2001
105
US
I have done this before and now I simply cant find the code snippert on how I did it.
Heres what I am trying to accomplish.

I have a form with one form box. I enter an ID# in this form box. Click submit, and I want it to go in the URL at the end of something that looks like this for example:

I WANT WHAT I PUT IN THE FORM BOX)

I think I used the GET method on the one box form.
Anyone have the quick fix to this? below is what I started with, obviously not correct :-(


<CFFORM METHOD=&quot;GET&quot; ACTION=&quot;<CFINPUT TYPE=&quot;Text&quot; NAME=&quot;carpid&quot; MESSAGE=&quot;Must Enter ID!&quot; REQUIRED=&quot;Yes&quot; CLASS=&quot;INPUT&quot;>
</CFFORM>
 
What you're describing is exactly the behavior of the GET method of form submittal. When you specify
Code:
method=&quot;GET&quot;
, the user agent appends the form fields as name/value pairs to the request URL specified in the
Code:
action
attribute of the form. It sounds like this is exactly what you are looking for, and you were really close to figuring it out. It's simpler than you thought.
Code:
<form method=&quot;GET&quot; action==&quot;[URL unfurl="true"]http://www.website.com/cgi-bin/carpgen&quot;>;[/URL]
   <input type=&quot;Text&quot; name=&quot;carpid&quot; class=&quot;INPUT&quot;>
</form>
Unfortunately, even if you specify
Code:
method=&quot;GET&quot;
for a
Code:
<cfform>
, ColdFusion overrides it and specifies
Code:
method=POST
in the
Code:
<form>
element on the resulting page. This is just one of the many drawbacks to using
Code:
<cfform>
. I recommend you stick to regular
Code:
<form>
and
Code:
<input>
tags and handle the validation yourself You could even adapt the functions that ColdFusion uses; just &quot;View Source&quot; on any page that uses a
Code:
<cfform>
tag.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top