Jump to content
  • 0
Sign in to follow this  
vdb@telenet.be

conditionally goto different webpage based on date input

Question

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.

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>

Share this post


Link to post
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.

Guest
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.

Loading...
Sign in to follow this  

×
×
  • Create New...