• Advertisement

Archived

This topic is now archived and is closed to further replies.

Making Hyperlinks act like submit buttons

This topic is 5251 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a hyperlink on a webpage and when clicked on i want it to post a value to appear as a query string on the page it opens. Is that possible with a plain link?

Share this post


Link to post
Share on other sites
Advertisement
If you just want to pass values in the query string, you can include them in the URL.


<a href="page.html?name=value">Click me</a>

Share this post


Link to post
Share on other sites
Yup, worked, thanks.

what if i want them to be ''post'' instead of being attached to the url?

Share this post


Link to post
Share on other sites
quote:
Original post by Mulligan
Yup, worked, thanks.

what if i want them to be ''post'' instead of being attached to the url?


Easiest way I know is to use javascript to post a form.


<form name="sample" action="test.html" method="post">
<input type="hidden" name="name" value="value">
</form>
<a href="javascript:document.forms.sample.submit();">Click</a>

Share this post


Link to post
Share on other sites

  • Advertisement