Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

link not working using form method

Posted on 2011-09-21
10
Medium Priority
?
282 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 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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 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=""/>
</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 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:
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

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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 set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Suggested Courses

564 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