TOPIC:

BF : radio button, string manipulation and no value 1 year 3 weeks ago #236691

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 224
  • Thanks: 5
Hi,

I've created a hidden element to create a column Department number 2 digits (Departement) from a Post ZIP code (CodePostal). I'm using radio buttons choice, text input for ZIP code and next/previous (custom button):

Element name: Departement

function ff_Departement_init() {
var code = jQuery('[name="ff_nm_CodePostal[]"]:checked').val() ;
// Get 2 digits
var dpt = code.substring(0, 3) ;
// Write 2 digits to 'Departement' element
ff_getElementByName('Departement').value = dpt ;
} // ff_Departement_init

I'm using similar code on a TEST Form, it's OK, both number or string

But on this bigger form (40 elements), I can't populate my var new data string "empty" to "Departement" element...

Any idea !
Thanks, Gil

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

BF : radio button, string manipulation and no value 1 year 3 weeks ago #236706

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
Hello,

From what you have written, this should work in case the ZIP code's value in "CodePostal" is prefilled before opening the page on which the Department field is.
In that case, it might be that you haven't checked the "Page Entry" checkbox in the "Initscript" section.

If you wish that the "Departement" field gets filled in after making a change like selecting a number in the "CodePostal", then the code shouldn't be put in "Initscript", but in "Actionscript".

Therefore, please go to the Actionscript section of the "CodePostal" field in your form. Set Type to "Custom" and mark "Change" as Action.
In the code below you should put code like this:
function ff_CodePostal_action(element, action) {
var code = jQuery('[name="ff_nm_CodePostal[]"]:checked').val() ;
// Get 2 digits
var dpt = code.substring(0, 3) ;
// Write 2 digits to 'Departement' element
ff_getElementByName('Departement').value = dpt ;
} // ff_CodePostal_action

Let me know whether that resolves the issue.

Regards,

Mihaela

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

BF : radio button, string manipulation and no value 1 year 3 weeks ago #236715

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 224
  • Thanks: 5
Hi,
My code was ok, as you explained.
I've implemented your way (copy your code, action change)
Same problem : Departement is still "empty", so not create in BF record ...

My simple BF TEST form works ok!
BR, Gil

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

BF : radio button, string manipulation and no value 1 year 3 weeks ago #236723

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
In that case, could you please send me a package with your form so I can see why this is not working.

Please create a package as explained here crosstec.org/en/support/online-documenta...ted/94-packages.html , zip it and send it as an attachment.

Regards,

Mihaela

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

BF : radio button, string manipulation and no value 1 year 3 weeks ago #236741

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 224
  • Thanks: 5
Hi Mihaela,
I've sent information to your email.
Gil

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

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

Summer Sale!

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!