The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Later than a set date - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8) +--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18) +--- Thread: Later than a set date (/showthread.php?tid=355) |
Later than a set date - Alexis - Nov 3rd, 2009 Hello i would like to use the later_date, but checking that the imput date is later than a set date, different than today's date. eg i would like to verify that inclusion date is later than nov 1st 2009 is there any way to do this ? thanks alexis RE: Later than a set date - Ben - Nov 22nd, 2009 Hi Alexis, Sure! Is this for the client-side (RSV) validation script or the PHP version? The built-in date functionality within the RSV script isn't very strong, so what you'd need to do is write a custom function that examines the form field value(s). Let me know which script you're interested in and I'll give you a few further pointers. - Ben RE: Later than a set date - Alexis - Dec 2nd, 2009 I am using RSV, but can switch to php if required. here's what i am trying to do: we use FT to include patients in a medical survey. rules of inclusion include - the patient can't be included before the study start date in the hospital (get the date from a database and transform to variable. date of inclusion is not date of today but 3 forms fields in the actual form. - the patient can only be included if the date of event (3 form fields day,month,year) is 2 days later than the date of admissions (3 form fields day,month,year). both in the actual form that i want to verify if i can do this, there are other more complicated date validations that i should be able to do thank you Alexis RE: Later than a set date - Ben - Dec 12th, 2009 Hey Alexis, Thanks for the reminder about this post. So! Here's some very general pointers on how to do this for the JS RSV script. Since the built-in date validation code is pretty basic, we're going to bypass it altogether and write a custom function to do the validation for us. First, add a new rule to your rule list: this will call your custom function. Code: rules.push("function,check_date"); Next, as you described in your post, the check_date() function needs to do a couple of things. I wasn't completely sure about the rules you need to check for, but here's an example of how it would look: Code: function check_date() { That's the gist of it... the validation logic will be the next bit to sort out. Basically you'd need to extract & compare the various dates and do the math on them. Sorry I'm being so general, but hopefully this gives you some idea of how to proceed - at least how to plug it into the main validation control flow. - Ben RE: Later than a set date - Susan W - Aug 31st, 2020 Thank you for the information about the Linux operating system that would be really wise. The people who need help with fixing the applications they can get the best help. I truly like college paper reviews update and really admire your trusted material here as well. |