link not working using form method

Posted on 2011-09-21
Medium Priority
Last Modified: 2012-05-12
I have the following but the link is empty inside my email when I receive it.  Any clue what is wrong with it?  It doesn't work in FF.

<form action="http://www.domain.com/activate" method="post" name="regId">
<input type="hidden" name="id" value="%%user_id%%"/>
<a href="#" onClick="document.regId.submit();return false">To finish the registration process, click here to activate your account at domain.com.</a>
Question by:COwebmaster
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

ID: 36578437
do view source in the email.... what do you get there?

Author Comment

ID: 36578500
not sure. can't really find it if I do a find in view source code.

If I hover over the link, it appears the # is appended to the page I'm on.

Can you tell if that code is bad?
LVL 15

Accepted Solution

Eyal earned 668 total points
ID: 36578510
the code seems to be OK.

I assume it's related to browser/application you are using to view the email message
maybe it blocks links
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.


Author Comment

ID: 36578522
does it need enctype in the form?

Author Comment

ID: 36578536
I tried adding enctype="text/plain" but it still does not work.
LVL 15

Expert Comment

ID: 36578565
try sending it to info at app4.biz
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 668 total points
ID: 36578567
Are you trying to execute a javascript from an email? That will not work

Instead do

<a href="http://www.domain.com/activate?id=%%user_id%%">To finish the registration process, click here to activate your account at domain.com.</a>

If that is not possible you need to pass the ID to a page that can handle it:

<a href="http://www.domain.com/beforeactivation.html?%%user_id%%">To finish the registration process, click here to activate your account at domain.com.</a>
in your email

and have a beforeactivation.html on your site

<form action="http://www.domain.com/activate" method="post" name="regId">
<input type="hidden" name="id" value=""/>
window.onload=function() {


Assisted Solution

jkofte earned 664 total points
ID: 36580310
Hello COwebmaster,
E-mails are not rendered the same way like HTML pages. So you have to get a different approach when designing your newsletters. Many e-mail servers apply filters to the e-mails before they show it to their clients. And most of the e-mail servers reject javascript code immediately.

It is a complex business to create e-mail newsletters because each e-mail server has its own filter. That's why people are still designing their e-mails as HTML tables and small texts instead of HTML divs. Each and every single action you do in an e-mail effects that it will be detected as spam or not. If you place js code, it can be filtered, if you place too many images it might be detected as spam.
You can view my article here to learn more about e-mail deliverability: http://kadirselcuk.com/?p=186

What you have to do is to place simple links using <a> tag's href property. Also keep in mind not to use forms in e-mails. ONLY use simple table-structured mails which contain only simplest of html elements. You should also place your CSS as inline CSS and only use some of the CSS properties. Please follow this link to see which CSS property is supported by which e-mail server (like gmail) or client (like outlook). http://www.campaignmonitor.com/css/

Also here are some good examples of e-mail templates:

Author Comment

ID: 36580642
okay, thanks for those comments.

@mplungjan, if I use your method, the user would click on that link in your email (free account like gmail), which would place them on the page called beforeactivation.html which would automatically forward them to the activate page.  Is that correct?

@jkofte, okay that all makes sense.

Author Closing Comment

ID: 36581784

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question