Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8163837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:09:13+00:00 2026-06-06T19:09:13+00:00

So I have this hidden form and this ‘I like this’ button that I

  • 0

So I have this hidden form and this ‘I like this’ button that I would like to insert into emails I send out.

<form method="post" action="http://someWebsite.com/he_likes_it">
    <input type="hidden" name="who_liked" value="heLikedIt@something.com" />
    <input type="submit" value="I Like This" />
</form>

I can insert the button into my email just fine. So, whenever an email recipient clicks on the button in their email, a POST request with the form data is sent to my server letting me know who liked my email. However, clicking on the button also opens up the link (new browser window/tab, etc.) directing the users to my site. How do I prevent the clicking of the button from opening the link and only just send the data in the form to my server?

I want the like button to be unobtrusive. I don’t want it annoying the email recipient by having a new tab open up. I know its possible with javascript, however, I’m pretty sure most email service provider escape javascript in emails as they should.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:09:15+00:00Added an answer on June 6, 2026 at 7:09 pm

    For starters, completely forget about javascript — it isn’t going to happen. No email client would allow JS through, it is simply too risky.

    As for the form method, putting aside whether the email client lets it through, if the page immediately closed itself (see snippet below), some operating systems, browsers, and email clients may play along and “give” the focus back to the mail client (which is what you’re after — the user is brought “back to where they were”). However, there’s no guarantee on how the client OS, browser, and email client will react.

    Further, some people use non-HTML clients, and some clients (like Outlook) will probably disallow this completely. From a security perspective, this has potential for exploit, so even if what you are doing is not exploitative, the entire practice has that potential and thus may be blocked.

    Non-HTML email clients may dump your HTML as text, so this will look pretty bad in that scenario.

    To close a window immediately, you can try:

    <script type="text/javascript">window.close();</script>
    

    So the page at http://someWebsite.com/he_likes_it consists of only this as output (after doing whatever server-side stuff needs to be done). Depending on the browser, and whether other tabs are open, and a few other factors, the window might just close without any problem. Might is the operative word! Then the user might be taken back to the email client. There’s no way to script this, no way to control it.

    As an alternative, I suggest you do something less prone to problems and the vagaries of email clients, OSes, and browsers… and that is far less “sneaky” — don’t conceal what you’re doing from the user. Instead of a form, simply include a link in your email:

    Like this email? Let us know: <a href="http://www.mysiteurl.com/he_liked_it/UNIQUE_IDENTIFIER">http://www.mysiteurl.com/he_liked_it/UNIQUE_IDENTIFIER</a>
    

    The unique identifier could be the email (which is what you were doing in your form anyway), or some kind of token that is linked to the user. In either case, on the page you can include some text to thank the user for their feedback:

    Thanks! We’re glad you liked the email. You can close this window, or
    click here to go to the main
    page.

    This is cross-browser, cross-OS, and will work for any HTML-enabled email client. For plain-text clients, they’ll be able to copy-paste the URL into their browser without seeing an overt amount of markup clutter. Your users will appreciate your transparency, your expressed gratitude, and that you’re not sending them emails that set off their email client’s security warnings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some hidden inputs like this <input name=exam.normals[1].blahblah ..../> I would like somehow
I have an ASP.NET web form where I have an hidden field, like this:
I have a popup <div> which clones a hidden form and inserts this into
I have this form : <form method='GET' name='search' action='index.php?explore=search'> <input type=hidden name=searchType value=all />
I have a form. This form submits via POST to an iframe, that, in
I have this form: http://dl.dropbox.com/u/14698783/project/register/form.htm The city input is hidden by default. I want
I have this form where a user can input tags (tag_list input) like Graphic
I have this form Im creating and when you click on the Next button
I have actually one classic Windows form and one button. I have this code
I have this form : <form action=index.php?explore=browse method=post> <input type=hidden name=artist value=<?=$artist?> /> <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.