Solved

link not working using form method

Posted on 2011-09-21
10
273 Views
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%%"/>
</form>
<a href="#" onClick="document.regId.submit();return false">To finish the registration process, click here to activate your account at domain.com.</a>
0
Comment
Question by:COwebmaster
10 Comments
 
LVL 15

Expert Comment

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

Author Comment

by:COwebmaster
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?
0
 
LVL 15

Accepted Solution

by:
Eyal earned 167 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
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:COwebmaster
ID: 36578522
does it need enctype in the form?
0
 

Author Comment

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

Expert Comment

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

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 167 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=""/>
</form>
<script>
window.onload=function() {
  document.regId.id.value=location.search.substring(1);
  document.regId.submit();
}
</script>

0
 
LVL 9

Assisted Solution

by:jkofte
jkofte earned 166 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:
http://www.campaignmonitor.com/templates/
0
 

Author Comment

by:COwebmaster
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.
0
 

Author Closing Comment

by:COwebmaster
ID: 36581784
Thanks!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery on Submit 4 46
On Load function does not trigger on iPhone 4 37
Easy css question moving title underneath an image 4 16
Wordpress Pricing 3 14
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

820 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