Forums

Custom code and required fields problem

crealex 14 Mar, 2014
Hi!

I have some questions. I just create one form with Chronoforms v5. Due to layout adjustments, I have decided to use the custom code with my structure and my css.

Here I have a general question, it is sufficient to create the form as html/css or I need some more code anywhere. In my form works such as validation not at all fields, but in designer the fields are required.

And one more question. I could use also wizard designer. But I have trouble with the structure that is created automatic ... too many classes, is, what I don't need. Can I adjust somewhere that the structure will be created from designer according to my pretending? Or it must be implemented only with custom code?

Generally I'm very good in css, less HTML and more less JS... so I need a bit help😉

Thanks and best regards
Alex
GreyHead 15 Mar, 2014
Hi Alex,

There's no problem with using your own HTML and CSS; to add validation you need to add the same validation classes as CF would add e.g. class='validate[required]'

Bob
crealex 15 Mar, 2014
Hi Bob,

thank you for your answer! Then I have some other problem, because the validation class is added to elements. Could be some other reason for this issue or can you look please on the form? I have it local but I can transfer it to the server and show you.

Thanks!
Alex
crealex 15 Mar, 2014
And other question. For example I make a form with my own HTML/CSS and want to have same events(e.g. enable one button if the checkbox is checked)? Where and waht I have to do, to make this events. Thanks again!
crealex 16 Mar, 2014
Hi Bob,

can you say me please, is it correct, that if I use the custom code, so I have to write the JS myself and put it in Setup to On load > [Load JavaScript]. So Designer area is completely disabled if I use my own code?

If that is correct, can you explain me please or give some link to a doc, how can I do this things (do I have some parameter from jvalidation.js, are there some docs?):

- if a special select option is chosen, show one addition field.
- validation of all fields. validate['required'] is'n work😟 so I can send completely empty form...

HTML/CSS is ready.

Thank you for help!
Regards,
Alex
GreyHead 16 Mar, 2014
Hi Alex,

I don't know how to do this with CFv5; at worst, you'd need to hand-code the JavaScript linking to your inputs.

Bob
crealex 16 Mar, 2014
Hi Bob,
in the CFv5 Designer I can do it in the tab "Events" of the element.
In my case:
Dropdown > Events
= Value -----> Show Field ID

So it works perfect. But just in Designer mode. I want the same, but wit own layout. Can I see the JS, what is generated in Designer Mode? May be i must put it in JS of the custom code and then it will work?

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