Solved

link not working using form method

Posted on 2011-09-21
10
277 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
[X]
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
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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

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

Technology Partners: 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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 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