Solved

link not working using form method

Posted on 2011-09-21
10
266 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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now