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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFORM action= question

Status
Not open for further replies.

Lesio

MIS
Jan 7, 2003
48
US
How should I modify the code below that mrnumber parameter is passed to url path of the action page?

When I hit submit, I want to see in the url: get_report.cfm?type=mr&mrnumber=xxxx

<cfform action = "get_report.cfm?type=mr" method = "post">

<div align="left"> <font size="2">&nbsp;
<input type="text" name="mrnumber">
</font></div>
<div align="left"> <font size="2">
<input type="submit" name = "submit" value = "Get Status">
</font></div>
</cfform>
 
Try method = "get"



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
no luck, any other way to pass this parameter, so that the link works OK ?
 
Drop the 'cf' and just use a regular form with method="get". That should pass everything in the url. I don't know why cfform doesn't like to play right sometimes.



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
mrnumber is a text box in the form that gets populated before submitting.

when you submit using method = "get" the form submits using url variables as ecobb said.

when you use method = "Post" the info in the form is sent with the request header data.

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Hi Lesio,

I would do this:

<script language="javascript">
function sendInfo(){
URL = 'get_report.cfm?type=mr&mrnumber=' + document.form1.mrnumber.value;

window.open (URL, 'newWindow', 'toolbar=yes,directories=yes,location=yes,resizable=yes,scrollbars=yes,menubar=yes,status=yes, width=800,height=600,align=middle');
}
</script>
<form name="form1">
<div align="left"> <font size="2">&nbsp;
<input type="text" name="mrnumber">
</font></div>
<div align="left"> <font size="2">
<input type="button" name = "submit" value = "Get Status" onClick="sendInfo()">
</font></div>
</form>

But if you don't want a new window you can just do location.href = URL;
instead of window.open

Hope that helps,

Peter [smile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top