TOPIC:

Init Script - Element Values are Null 6 months 3 weeks ago #255116

  • Topic Author
  • davidtilton
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
I have a multi-page form with an init script that references saved elements within the form to determine which page to start on. So, whenever a user navigates back to the form on the Joomla website, the user is brought to the first incomplete page. The script uses the ff_getElementByName to reference the saved elements. This was all working as expected in the past, but somewhere along the way between either a Joomla or BreezingForms update, the form now does not read the saved elements when the init script runs. Instead, the saved elements are read as nulls. As soon as the form loads, I can run another script to read the elements and their values are correct.

So, my questions:
1. Should I be able to access saved element values in the init script?
2. Is there an alternative method I should use for getting the element values other than using ff_getElementByName in the init script?

Thank you.

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

Init Script - Element Values are Null 6 months 3 weeks ago #255119

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6963
  • Karma: 3
  • Thanks: 494
Hi,

1) please enable "submission editable by user" in the BF menu item or module item settings (depending if call the form using a menu item or a module).
For this the users need to be logged in. That's all they they need to do.
Once they re-open the form again after the first submission, their old entries should appear, and user can continue filling out the form.

2) in Init script you should to use javascript, and if you want to get value of element then use this:
ff_getElementByName('nameofelement').value

Hope this helps

Regards,
Tihana

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

Init Script - Element Values are Null 6 months 2 weeks ago #255301

  • Topic Author
  • davidtilton
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
Hi Tihana,

Thank you. To confirm:

1) Yes, "submission editable by user" has always been enabled.

2) Yes, I have been using ff_getElementByName('nameofelement').value to get the value of elements.

When I use ff_getElementByName('nameofelement').value in my Form Init script (javascript), it reads the element values as null. However, once the form loads, the element values are all there, so I know they are being saved. If I test using ff_getElementByName('nameofelement').value after the form loads, it returns the correct element values, so something unexpected is happening during the Form Init script. Have you come across anything like this before?

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

Init Script - Element Values are Null 6 months 2 weeks ago #255304

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6963
  • Karma: 3
  • Thanks: 494
Hi,

did you put this code in form->Advanced->More options->Scripts->Initalization script or in element->Advanced->Init script?

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Init Script - Element Values are Null 6 months 2 weeks ago #255307

  • Topic Author
  • davidtilton
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
I put it in: form->Advanced->More options->Scripts->Initalization script

However, it is there as a library script rather than a custom script because the script is saved in the script library.

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

Init Script - Element Values are Null 6 months 2 weeks ago #255331

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6963
  • Karma: 3
  • Thanks: 494
Hi,

could I access to your page, and test this?

If yes, please send me login information and backend link

Use this tag:
[confidential]
[/confidential]

Regards,
Tihana

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

Time to create page: 0.052 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!