Jump to content
  • 0

conditionally goto different webpage based on date input



1 answer to this question

Recommended Posts

  • 0

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.



var today =new Date();
var signup = new Date( "[@authfield:Date_Submitted]" );
var valid = new Date();


if (valid<signup)
document.location = "http://www.caspio.com";
/*Not Valid*/
window.location = "http://www.google.com"

Link to comment
Share on other sites

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.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...