TOPIC:

BF Scripts documentation 9 years 6 months ago #69058

  • Topic Author
  • JinaLabina
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Where can I find information on the specific semantics of the scripts section of BF?

In particular, in advanced settings, there are three tabs for scrips, each having two sections (before, after). Where can I find information on what each means (that is, when will the code there be called, etc).

Thanks!
Adnan

Please Log in or Create an account to join the conversation.

Re: BF Scripts documentation 9 years 6 months ago #69132

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
Hi,

you can find it in the knowledgebase:

crosstec.org/support/

Let me exaplain it for your convenience here:

- Scripts Tab

==> Initialization Script: A javascript that should be executed on form initalization (=loading)

==> Submitted Script: A javascript that will be triggered after the form has been submitted.

- Form Pieces Tab

==> Before Form: PHP that should be executed before the form is rendered. You can for example print something out and it will be displayed on top of the form.

==> After Form: The same like above but will be executed after the form is rendered. So printing will happen in the end of the form

- Submit Pieces Tab

==> Before Submit: PHP that will be executed before the form is going to be submitted. You can use this for example catching values and prevent storing a submission.

==> After Submit: Same like above, except that it will be executed after a submission has been stored.

All of these tabs above share the same concept:

- Library: You can wether choose a predefined script/piece from the library. While each item of the library can be packaged itself. Means, you can create your own library items and re-use them in other forms.

- Custom: You can add code directly in-place for one of the actions above. For custom scripts it is required that you click "create code framework" first in order to have a javascript function skeleton where you place your code into, while for pieces you can start writing your custom code without the need to create a function.

Things you always want to use in a Piece (PHP):

ff_getSubmit('FIELDNAME') => will return the value of a field

ff_getSubmit('FIELDNAME', FF_ARRAY) => will return the value of a field as array. required if you want access to vaues of a group like a checkbox

As soon as you use things like ff_getSubmit() in your piece, put this as first command into your custom code:

$this->execPieceByName('ff_InitLib');

Things you always want to use in a Script (Javascript):

ff_getElementByName('FIELDNAME') ==> will return the DOM object of the field
ff_getElementByName('FIELDNAME').value ==> will return the value of that field

The same is applicable for scripts that you use for validations, actions and initializations on field level.

Hope that gives you an initial overview of the pieces and scripts!

Regards,
Markus

Please Log in or Create an account to join the conversation.

Re: BF Scripts documentation 9 years 6 months ago #69257

  • Topic Author
  • JinaLabina
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Thank you Markus! This is most helpful.

Please Log in or Create an account to join the conversation.

Re: BF Scripts documentation 9 years 4 months ago #74384

  • sapphireweb
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 116
  • Thanks: 0
Markus,

Thank You. This helps clear up some of my confusion. :)If I understand correctly "Form Pieces" (Under the Manage Pieces) are all PHP, and Scripts (Under Manage Scripts) are JavaScript. Id just like to clarify a couple of things, to make sure I understand.

1. I only need to use "$this->execPieceByName('ff_InitLib');" once in the initialization block of the form correct? And not in each individual script block within the form itself?

2. $this->execPieceByName allows me to call a Form Piece (PHP) from a JavaScript block?

I have need to pass the contents of a javascript variable to the <?php ?> block within the field_change action script of a form field. What is the best way to do that?

- Thanks

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.048 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!