While setting up Use Well The Days, I decided to use Feedburner for email distribution of Jerilyn's posts.
I've written a subscription page that tells users how to subscribe to the blog. Within the main content of that page, I needed to place the standard Feedburner form where you enter your email address and click a Subscribe button. However, Feedburner's stock script is wrapped within a form tag. That doesn't work too well when the contents of the body is already wrapped by an ASP.NET form tag.
Instead of solving the problem from scratch, I looked at some Community Server blogs already in my feed reader. Jason Knight uses Squeet.com for email delivery and the script on his blog was just what I needed. I mutated the Feedburner script to the pattern given. A template is below for whomever needs to solve the same problem.
<p class="maintext">Subscription emails are delivered by
<a href="http://www.feedburner.com/" target="_blank">FeedBurner</a>
</p>
<p class="maintext">To subscribe, please enter your email address:</p>
<p class="maintext">
<input type="text" style="width:140px" name="email" id="fbEmail"/>
<input type="submit" value="Subscribe" onclick="fbSubscribe();"/>
</p>
<script language="javascript" type="text/javascript">
function fbSubscribe()
{
if (document.getElementById)
{
var fbEmail = document.getElementById('fbEmail');
var fbUrl = "http://feeds.feedburner.com/~e?ffid=[ ID FROM STANDARD FORM HERE ]";
if (fbEmail)
{
window.open('http://www.feedburner.com/fb/a/emailverify?url=' +
fbUrl + '&title=[ BLOG TITLE HERE ]&email=' + fbEmail.value,
'popupwindow', 'scrollbars=yes,width=550,height=520');
return true;
}
}
}
</script>
Tags: Community Server, Feedburner