Jump to content
  • 0

Data Page - Submission Form


Go to solution Solved by Mathilda,

Question

I would like to add a rule to a data page that prevents a user from selecting an erroneous date, ie anything after a certain like the current date or something after a age limit for the application.  When I try to choose greater than or equal to for the birthday calendar field, it does not allow me to add a condition that prevents the user from proceeding.  Is there a way to do this inside the data page?  Thank you.

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 1
  • Solution
10 hours ago, danielg05 said:

I would like to add a rule to a data page that prevents a user from selecting an erroneous date, ie anything after a certain like the current date or something after a age limit for the application.  When I try to choose greater than or equal to for the birthday calendar field, it does not allow me to add a condition that prevents the user from proceeding.  Is there a way to do this inside the data page?  Thank you.

This kind of validation can be done using Java Script. Have a look at this post

Link to post
Share on other sites
  • 0

This was a huge help, thank you Mathilda.  I enhanced that set up with the following.  Fyi @Community swap your value with "DATEFIELDNAME" and this will go back a revolving 1 year without manual intervention:

<script>
 var Marker = new Date();
Marker.setFullYear(Marker.getFullYear() - 1, Marker.getMonth());

function chk_date(){
var mydate = document.getElementById('InsertRecordDATEFIELDNAME').value;

if ( Date.parse(mydate) >=  Marker) {
alert('pick a date before the marker');
return false;
}

}
document.getElementById('caspioform').onsubmit=chk_date;
</script>

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...
×
×
  • Create New...