Jan 16th, 2010, 9:23 PM
(Jan 16th, 2010, 11:45 AM)Ben Wrote: Hey bvdveen,
For something custom like this, you'll definitely need to look into the custom function option. What that does is let you supplement the existing validation rules (required, valid email, is numeric, etc.) with your own custom ones. Check out the "custom validation rules" link on the top right of this page:
http://www.benjaminkeen.com/software/rsv/standalone/
Basically it works by adding a rule like so:
Code:rules.push("function,check_times");
Then writing your own function that would do the manual labour of figuring out what was valid and what wasn't:
Code:function check_times() {
// do stuff here
}
The return values of that function need to be a particular format, as is described in that page above.
Hope this at least gets you on the right track...!
- Ben
Hi Ben!
Thanks for your answer.
The problem - as you may have concluded already :-) - is that I an not sure how to write the code correctly. Believe me I have read over and over your example of a custom validation rule (prime numbers)
I simply don't know how to make sure my rule works.
I need something like:
field a = "begin_"time"
array: 06:00|06:15|06:30|06:45|07:00(etc).......|19:00
field b = "end_time"
array: 06:00|06:15|06:30|06:45|07:00(etc).......|19:00
rule: field b >= field a.
A solution I have thought of might be:
field a = begin_hour
array: 06|07|08|.....|19
field b = begin_minute
array:00|15|30|45
field c = end_hour
array: 06|07|08|....|19
field d = end_minute
array = 00|15|30|45
rule 1:
field c>=field a
rule 2:
field d<>field b
maybe with one more hint from you I could do it!
Sorry to have bothered you again with this...
Greetings
bvdveen