Skip to main content
November 12, 2007
Question

url parameters not working

  • November 12, 2007
  • 4 replies
  • 546 views
Hi,

I haven't had trouble with url parameters before now, but the attached code is not passing the parameter and I can't figure out why. Any help would be appreciated.
This topic has been closed for replies.

4 replies

November 12, 2007
Thanks cf_dev2.
November 12, 2007
You're right, there were some copy/paste mistakes. I removed the form tags and changed the link code to:

<td><a href="editstick.cfm?ID=#Posts.postsid#"><cfoutput>#Posts.postsid#</cfoutput></a></td>

However, the url parameter is still not being passed on. In Firefox, the status bar shows http://mysite/editstick.cfm?ID=#Posts.postsid# rather than the numeric id ( http://mysite/editstick.cfm?ID=1). On other pages I've done, Firefox shows the numeric id rather than the #recordset.fieldname# combination. I don't want to display my data in single rows, but that's the only way I've ever done it before. Sorry to be so dumb.
Inspiring
November 12, 2007
> <a href="editstick.cfm?ID=#Posts.postsid#"> ...

There's no cfoutput around the url parameter value. That's why its not evaluating the id.

Rather than using all those separate <cfoutput> tags, why not just use <cfoutput query="..."> instead of <cfloop query=".."> ?
Inspiring
November 12, 2007
> <cfloop query="posts">
....
> <td><a href="editstick.cfm?ID= Posts.postsid method=get"><cfoutput>#Posts.postsid#</cfoutput></a></td>
> <td><a href="editstick.cfm?ID=#Posts.postsid#"></a></td>

Your query values probably won't be evaluated if they're not surrounded by # signs or enclosed in either <cfoutput> tags or a <cfoutput query="..."> loop. Also, it looks like you've got a copy+paste error: method=get"

Inspiring
November 12, 2007
> For openers, you don't have the required ACTION="actionPage" in your form tag

If an action isn't supplied, the form should submit to the same page by default. But I'm not sure why they are using a form at all .. as there seem to be no form fields in the code.
November 12, 2007
>> For openers, you don't have the required ACTION="actionPage" in your form tag

>If an action isn't supplied, the form should submit to the same page by default.

That may or may not be the case current browsers, but the HTML 4 specification at W3C states that it is required. Check it out at: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.3
November 12, 2007
For openers, you don't have the required ACTION="actionPage" in your form tag. See http://htmlhelp.com/reference/html40/forms/form.html for more information on the FORM tag.