Jump to content
  • 0

Generating Text On Search





I am new to Caspio.  I have created a datapage that tracks volunteers who are eligible to serve in a certain capacity only once per year; therefore, is there a way to generate text "Ineligible to serve" if the date of last service is within 365 days of search?





Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

You can try this script on your search form in the footer of the page:

function f_search(){
var d = document.getElementById('ID OF THE DATE FIELD ON SEARCH PAGE').value;
var myDate = new Date(d);
var someDate = new Date(d);
myDate.setDate(myDate.getDate() - 365);
if (someDate  > myDate){
alert('Ineligible to serve');
return false;
document.getElementById('caspioform').onsubmit = f_search;

replace ID OF THE DATE FIELD ON SEARCH PAGE with the corresponding ID.

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