Answered

values of hidden fields with comma's

  • 20 February 2023
  • 7 replies
  • 171 views

As you can see some of the values of the hidden fields of this type embedded form link contain commas

Because the fields are also separated with commas the data is not completely send and stops after the first komma of a hidden field.

price=2,325.00
Becomes 2

name=Draaibank 250x550 mm met digitale uitlezing, inverter en AC motor
Becomes Draaibank 250x550 mm met digitale uitlezing

 

<a class="foo" data-tf-size="70" data-tf-popup="QxwL3CPS" data-tf-hide-footer="" data-tf-hidden="
            sku=15433,
            type=LTC DR 550I Vario-2 SINO,
            price=2,325.00,
            name=Draaibank 250x550 mm met digitale uitlezing, inverter en AC motor,
            brand=Huvema" data-tf-loaded="true">Informeer naar de levertijd</a>


Is there any way to escape the commas in the hidden fields?

icon

Best answer by jeremielp 22 February 2023, 19:38

View original

7 replies

Userlevel 7
Badge +5

Hi @centervanliempd I’m afraid we don’t have this feature available (if you mean the data leaving the typeform, not entering it), but I can share this request with the product team. 

Hi @Liz

thank you for your reply.


When using a share popup button, the data being saved by the TypeForm platform stops when it encounters a komma inside the value of the tf-hidden parameters.

 

In the screenshot you will see that its missing the part ‘inverter en AC motor’

name=Draaibank 250x550 mm met digitale uitlezing, inverter en AC motor

Also the price should be 2,325.00
 
The tf-hidden data is added dynamically with PHP, I could do a string replace at this time.

 

regards,
Center
 

 

Userlevel 7
Badge +5

Thanks for the additional information, @centervanliempd ! I’ve shared your feedback with the product team. 😀

Userlevel 5
Badge +5

One option is to dynamically create the Typeform using the embed API

Below is the code that loads one form static. When using this method, the hidden fields are loaded using a JSON, so you can format the values the way you want. You would have to modify so that it get executed on a click on a button.

<script src="//embed.typeform.com/next/embed.js"></script>
<script>
window.tf.createWidget("[form id]", {
container: document.querySelector('#form'),
hidden: {
'sku': '15433',
'type': 'LTC DR 550I Vario-2 SINO',
'price'; '2,325.00',
'name': 'Draaibank 250x550 mm met digitale uitlezing, inverter en AC motor',
'brand': 'Huvema'
}
})
</script>

 

Another option, if you can get your parameters in the URL of the page, would be to use the following parameter and let TF read from the URL of the page..

data-tf-transitive-search-params="sku,type,price,name,brand"

Doc here: https://www.typeform.com/help/a/dynamically-pass-hidden-fields-from-a-url-to-an-embedded-typeform-for-advanced-users-4404652303892/

Userlevel 7
Badge +5

Thank you so much, @jeremielp ! @mathio , I think you might have another helper in terms of code! 😂😀

Thanks for the push in this direction @jeremielp 
I could give this a try.

When looking at this pages I should be able to find some solutions.
https://www.typeform.com/developers/embed/modal/

Userlevel 7
Badge +5

@mathio , I think you might have another helper in terms of code! 😂😀

Thats awesome 🚀

Reply