Hi,
in a dropdown menu with an array of dynamically created years, I want to open a second field, if a year of the four recent years has been selected.
Unfortunately, the "events" section of "edit element" offers only '=' or '!='.
How can I make '>=2016' work in this element?
Thx!
Hi HerKle,
You could use four '=' events, or - maybe better - use custom JavaScript.
Bob
Thanks Bob,
but the case is that with your idea next year I had to update the then new four recent years. I am searching for sth. automated like ">= date('Y')-4".
Unfortunately, I never worked with JavaScript (which I learned can be deactivated by the user so that forms won't work properly).
Too bad. :-(
Herbert
ANYTHING you use on the front end can be deactivated by the user, and those form events you're talking about are still based on Javascript. You would need a javascript function on the front end (views), and a PHP check on the backend (actions), and for both of those you can dynamically set the year based on the current year.
Well, healyhatman, as said, I never worked with JavaScript. So I have not the slightest idea how to create the javascript function, you are talking about. But thx anyway.
Herbert
Well you can use = in the field events, with 4 values each on a ddiffernt line.
{date:Y$today -1 year)}
But that only works if your field is year only. Otherwise it's 2am so you're on your own for a bunch of hours
Thx healyhatman,
{date:Y$today -1 year)}
I haven't seen this syntax yet, I am prepared to try it, but you have a closing bracket, which were nowhere opened - and I don't know where to put it.
Herbert
Gey rid of the closing ) it's not supposed to be there
I tried in Element Settings > Events:
First event: On '=' {date:Y$today -1 year} 'show parent' 'nextfield'
Second event: On '!=' {date:Y$today -1 year} 'hide parent' 'nextfield'.
The nextfield isn't shown at all - even when I select '2018' from my years' field. :-(
Sorry. {date:Y$-1 year}
Again though this only works if your field is year only.
Sorry, this doesn't work either.
My field "year" is 'year only' but the third field within a multi-field construct.
Might that be a reason for malfunction (although each of the fields has its own event section)?
Thx. Herbert
Ahh well worth a try. Looks like you'll have to program it yourself. The actual value is stored in a hidden field after the visible field.
Post a screenshot of your field event just in case though
I get "Error saving the attachment file" with 640px wide and 38 kb sized jpg file, when trying to upload the screenshots. This forum is strange. Is it better working with other browsers than latest Firefox?
Try using snag.gy there is a problem with the forums right now
Dropdown field "Years" loading data dynamically:
https://snag.gy/aQkKlD.jpg
Dropdown Events:
https://snag.gy/GWeU5I.jpg
And once again I failed to see the Chronoforms v5 tag. Ignore everything I've said, it's all for V6 and none of it works on the obsolete v5.
You'll have to do it all manually with JavaScript and I can't help you, only Bob does the old v5 stuff.
I would have purchased v6 since long - if only the payment methods weren't limited to credit card or paypal - neither of which I can use.
What payment method CAN you use?
In Europe it's also common to pay immediately from your bank account via a direct payment service, eg. Klarna.com.
IBAN and BIC of the vendor must be available.
Well then maybe Max will integrate my Mollie payment plugin on his payment page ?