Buy Now
Sign in

Chronforms V6 $form->data

NickOg 832
May 26 2017, 02:09 #368643
Just taken my first look at CF6 & CC6. Impressive but different to CF5/CC5 but looks like CF6 & CC6 are much more alike. It will take me a while.

Two quick questions
    Do I need to pay these to validate? OK if I do - just need to know.

    In CF6 what is the equivalent of $form->data? Something in $this - but what


I suspect from a quick look at the forum that $form->data approach in pho code is either obsolete or not necessary.

Thanks

Nick
admin 28
May 26 2017, 05:49 #368646
 Answer
Hi Nick,

Same validation keys should work fine!

$form->data is now $this->data, but there is also a shortcode syntax which you can use, like {data:field_name}, I'm trying to write a manual soon.

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
NickOg 832
May 26 2017, 06:40 #368651
 1
Thanks Max - manual in your spare time???. I look forward to it - in the meantime I think the demos will give me a kick start wit that piece of information.

Regards

Nick
S
stijnst 30
May 26 2017, 21:57 #368686
Hi

thanks for the tip, this helped me a lot as well.

{data:fieldname} or {var:fieldname} seems to return an error message if used as a variable inside a custom php code block:
$result={data:input};


using it inside a double quoted string however, seems to work fine:
print("you typed: {data:input_number}");

So I guess the php code is executed first, and the {data:...} blocks are filled in afterwards. The following statement will display the content of the 'input_number' form field:
print(":{data:"."input_number}");


Also, returning data out of a custom php code block seems to be not working. instead of:
return $result;

and using it as {var:result} or {data:myVar} later on in a confirmation email, I had to set it as
$this->data['result']

in my custom php code in order to use it.
NickOg 832
May 26 2017, 23:19 #368687
Great stuff Max - well on the way.

Thanks

Nick
NickOg 832
May 27 2017, 00:09 #368688
Some questions now pop up no doubt. I can't find an example for including CSS. I have found where to define some CSS and have included this

form#history-list{
background-color:aqua !important;
font-size:10px !important;
width:90% !important;
}
and named it
historyCSS


Three questions
    How do i reference that on pages/events?

    How can I include reference to a CSS file or files? Using the CSS @import?

    Can one use a php require command to include css files - similar to CF5??


Nick
admin 28
May 27 2017, 08:50 #368694
Hi Nick,

This is a Chronoforms or Connectivity question ? in Connectivity you need to call the view or function, but in Chronoforms its enough to place the code in a custom CSS element.

You can include a CSS file using a Custom HTML element, you may also require a CSS file that way since the HTML element supports PHP.

@stijnst, please check this FAQ:
https://www.chronoengine.com/faqs/74-chronoforms6/5289-variable-shortcodes.html

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
NickOg 832
May 27 2017, 20:33 #368718
 1
Hi Max

Sorry - it was Connectivity related. Thanks for that info - and those FAQs.
Making more progress.

Nick