designer events tutorial

emmexx 27 Jul, 2016
Is there a tutorial on how to use the designer events found on designer events tab?

Otherwise, is there a cfv5 tutorial or faq on enabling/disabling validation for some field?

Thank you
maxx
GreyHead 27 Jul, 2016
Hi Maxx,

There's no tutorial that I know of :-(

What exactly do you need to do? Sometimes you can turn validation on and off by disabling or hiding the input. Unfortunately the validations are set when the form loads and I haven't found a way to change them after that. When I need to do so I have switched to using the jQuery validation library which offers more control.

Bob
emmexx 28 Jul, 2016
In part it is curiosity: it is there but I don't know what to do with it.
I tried to debug the code generated by a disable/enable validation but I couldn't get it to work. And what you wrote (the validations are set when the form loads) is in contrast with what I understand from the code.
The event adds js code like
(...).on('change', function()...
so I expected to see that code executed when a select o input radio changes. But in firebug nothing happens.

Anyway I was looking for a simple way to change the required fields based on the value of another field. I did this in CFv4 but now it is more complicated, probably adding/removing the validation[required] class is not enough, the required marker must be managed and so on. I suppose I should check the classes used by cf and manage them using js. But I'm lazy. 😉

But a method to manage validation based on other fields values would be a very useful feaure in CF.

Thank you
maxx
GreyHead 28 Jul, 2016
Hi Maxx,

You can run a function onChange - the problem is that, at that point, changing the class doesn't change the validation as that was set when the form loaded.

Bob
GreyHead 28 Jul, 2016
Hi Maxx,

You can run a function onChange - the problem is that, at that point, changing the class doesn't change the validation as that was set when the form loaded.

Bob
This topic is locked and no more replies can be posted.