0
Can a href command be used to post rather than get?
Contributor
,
/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/td-p/193013
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
Hi - is there some way to use a standard href=myPage.cfm to
post information rather than get, as in:
href=myPage.cfm?topic=123
TOPICS
Advanced techniques
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/m-p/193014#M17422
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
You can do this but it's a bad idea.
A better way is to keep forms for posting and alter the submit button(s)' appearance, if you wish, without hiding its/their purpose.
- It breaks
the
web paradigm which confuses users and breaks down their trust.
- Visitors without javascript, or using mobile devices or voice
readers will not be able to use your site.
- Search engines can
destroy
your data!
- Users with Firefox, etc., pre-fetch extensions can
destroy
your data!
- Do you really want users to be able to bookmark say, "Delete
this entry" or "Add new junk to my site with one click and no
thought"?
A better way is to keep forms for posting and alter the submit button(s)' appearance, if you wish, without hiding its/their purpose.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Karen_Little
AUTHOR
Contributor
,
/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/m-p/193016#M17424
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
Do you know how to do it? You don't have to worry how I will
use it.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Karen_Little
AUTHOR
Contributor
,
/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/m-p/193017#M17425
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
Hi - it's very easy to attach a url variable to a link. This
forum, for example, uses that construct. What I'm looking for is
the means to execute a post by using a link, rather than a form
setup.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/m-p/193018#M17426
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
You've already been told how to do it and also some of the
reasons why it's a boneheaded idea.
I will not show you any other methods (just like I wouldn't help a mugger with his planned tasks).
I will not show you any other methods (just like I wouldn't help a mugger with his planned tasks).
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Karen_Little
AUTHOR
Contributor
,
LATEST
/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/m-p/193019#M17427
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
Forgive! I didn't see the lower half of the message. My bad!
As I said - please don't worry about the application. If there are other ways, I'd greatly appreciate knowing.
As I said - please don't worry about the application. If there are other ways, I'd greatly appreciate knowing.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/can-a-href-command-be-used-to-post-rather-than-get/m-p/193015#M17423
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
I don't think you can post a variable by means of a link. For
example, doing <a href="myPage.cfm?form%2Etopic=123"> wont
work. A link cannot create the form scope on the action page. Only
tags like <form> and <cfhttp> can.
However, if you insist on using a link, Javascript could come in handy.
sender.cfm:
<a href="javascript: document.poster.submit()">Post it</a>
<cfform name="poster" action="myPage.cfm" format="HTML" method="POST">
<cfinput name="topic" type="Text" value="123">
</cfform>
myPage.cfm
<cfif isDefined("form.topic")>
form.topic: <cfoutput>#form.topic#</cfoutput>
</cfif>
However, if you insist on using a link, Javascript could come in handy.
sender.cfm:
<a href="javascript: document.poster.submit()">Post it</a>
<cfform name="poster" action="myPage.cfm" format="HTML" method="POST">
<cfinput name="topic" type="Text" value="123">
</cfform>
myPage.cfm
<cfif isDefined("form.topic")>
form.topic: <cfoutput>#form.topic#</cfoutput>
</cfif>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

