date picker between two dates

elle

Member
Hi there,

I have an form with a repeated group.
In this repeated group I have a date-field (cal-picker). What I wanna to have is, that the date-picker only allows to pick up dates between the date, who's defined in two date-fields in the unrepeated group.

date elements in the unrepeated group are:
0_gpa_abrechnung___1_von and
0_gpa_abrechnung___1_bis

the date element in the repeated group is:
0_gpa_abrechnung_19_repeat___2_datum

In the "Allow date function" I've added the following code, wich is not working:

Code:
var start= form_14.formElements.get('0_gpa_abrechnung___1_von').getValue();
 
var end = form_14.formElements.get('0_gpa_abrechnung___1_bis').getValue();
 
 
 
var diff = start.compare(end);
 
var result = diff > 0 ? true : false;

Cant you help me please to get it work.

Many thanks
Elle
 
We pretty much always need access to the page to debug any kind of custom JS issue. So in order for us to help, you'll need to do two things:

1) Move that code in to a function, which you put in ./components/com_fabrik/js/form_X.js (where X is the numeric form ID, left most column of the main list of forms on the backend). Have that function return true or false, and then call that function from the Allow Date box to set the result var ...

Code:
var result = myAllowFunc();

This will allow us to debug the code, by using breakpoints in the Chrome or FF debug tools, which is hard to do for "inline" code, much easier if the code is wrapped up in a function. Call the function whatever you like, that's just an example.

2) Point us at the page.

-- hugh
 
Hi Hugh,

thanx for your help.

I've putted the code in to a function, like you described. The function is in form_14.js in the folder ./components/com_fabrik/js/

Maybe you'll need a access to the backend site. I have prepared a user to access fabrik.
I'll send you the login access via pm.

I wish you the best for your surgery today. I have the same prob with my neck C5/C6 and also L5/S1 - but yet without a needed surgery.
So please get well again and then hopefully help me with my fabric-problem.

Best regards
Elle
 
Hi troester,

thank you for your support.
I have submit the site informations via the link you wroted before.

Thanx
Elle
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top