Jump to content
  • Advertisement

Archived

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

Mulligan

Making Hyperlinks act like submit buttons

This topic is 5544 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!