Ingress Online Website Design / Development and Online Services Wangaratta North East Victoria

I build small business websites,

setup and manage your social media.

FacebookLinkedInTwitterEmailPrint

Automatically set expiry date on Secure Zone in Business Catalyst

04-Feb-2011 I have been struggling with this for days and the forums on Business Catalyst are piecemeal so I thought I would put the solution here for my own reference and for anyone else that maybe stuggling.

Problem


I want to subscribe a user to a secure zone for only 12 months but instead of doing it manually I want to automatically set an expiry date when they fill in the signup form.

Solution

Insert this code into the form somewhere, it just needs to be between the form tags. Keep the value="1-Oct-2008" as this gets overwritten.

<input type="hidden" value="1-Oct-2008" name="ZoneExpiry" id="ExpiryDate"/>
 

This code needs to go at the bottom of the page.  The "+ 365" part can be set to however many days out you want the expiry to be.

<script type="text/javascript">
function setExpiryDate( )
{
var dat=new Date();
dat.setDate(dat.getDate() + 365);
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec")
var pretty = dat.getDate() + "-" + monthname[dat.getMonth()] + "-" + dat.getFullYear();
document.getElementById("ExpiryDate").value = pretty;
};setExpiryDate( );

</script>

The code on these pages is not clear.

http://onlinebusinesswiki.com/index.php/Secure_zone#Setting_the_expiry_date_for_a_secure_zone_subscription_upon_the_web_form_submission

http://businesscatalyst.com/ForumRetrieve.aspx?TopicID=13977&A=SearchResult&SearchID=1928024&ObjectID=13977&ObjectType=43

http://businesscatalyst.com/ForumRetrieve.aspx?TopicID=13130&A=SearchResult&SearchID=1928024&ObjectID=13130&ObjectType=43

Comments



Comment on this article


No Very