vdb@telenet.be Posted January 24, 2011 Report Share Posted January 24, 2011 Based on the user date input -> goto to different webpage.. for example.. If date is less then 3 days from now goto page A If date is more then 3 days goto page B If someone can help me out to do this (javascript?) thank you. Bart Quote Link to comment Share on other sites More sharing options...
0 eprouver Posted January 26, 2011 Report Share Posted January 26, 2011 Hi Bart, The easiest way to accomplish this is to use an auth field parameter which pulls data directly from the current authenticated user. Stick this JavaScript into an HTML Page (located under Custom DataPage type). In my case the user record had a field called Date_Submitted, you might have to change the name of that field parameter for your purposes. Anyway, when the user logs into the HTML page, the script first figures out what the date was three days ago. The JavaScript then compares the user's date_submitted date to that and directs the user's browser based on what it finds. I hope this helps you out. Eprouver <script> var today =new Date(); var signup = new Date( "[@authfield:Date_Submitted]" ); var valid = new Date(); valid.setDate(today.getDate()-3); if (valid<signup) { /*Valid*/ document.location = "http://www.caspio.com"; } else { /*Not Valid*/ window.location = "http://www.google.com" } </script> Quote Link to comment Share on other sites More sharing options...
Question
vdb@telenet.be
Based on the user date input -> goto to different webpage..
for example..
If date is less then 3 days from now goto page A
If date is more then 3 days goto page B
If someone can help me out to do this (javascript?)
thank you.
Bart
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.