peti73
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] Hide script in html content or do shortcodeWell, it works, but with this method i cannot put the API-call on Page 2 as it is outside the form.
Maybe the SERVER_SIDE Equations add-on will do the trick.
Forum: Plugins
In reply to: [Calculated Fields Form] Hide script in html content or do shortcode< code > 1872.11 < /code >
(without the spaces)Forum: Plugins
In reply to: [Calculated Fields Form] Hide script in html content or do shortcodeHi,
[metalpriceapi price_round="2"]
shortcode just gives a number, the actual price.
Ie.
1872.11
Can i insert that shortcode in a field?
Thanks!
Forum: Plugins
In reply to: [Calculated Fields Form] Validation or dependencies for next buttonHi,
You helped me free a lot, now i made a request for a customization service.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Validation or dependencies for next buttonHi,
on Page 1 there is only a required “Single Line Text” field with a regular expression like this:
/^ABC((1[0-9]{2})|(200))$/
which functions like an “entry code”.On Page 2 there is the field with the API-request.
If i enter the wrong code on Page 1, obviously i can’t go to Page 2 with the “Next” button. But even after this i enter the correct code, and step to Page 2, the API isn’t called anymore.
Does it make sense?
Thank You again!
Forum: Plugins
In reply to: [Calculated Fields Form] Validation or dependencies for next buttonHello,
almost perfect!
There’s one problem though: if I enter the wrong code the first time, then even if I continue with the correct code, the API request isn’t made and that price field remains empty.Forum: Plugins
In reply to: [Calculated Fields Form] Validation or dependencies for next buttonUnfortunately it doesn’t work.
Now the API-request isn’t made at all.<script> jQuery(document).one('cff-gotopage', function(){ if(jQuery('[id*="cp_calculatedfieldsf_pform_"]').valid()){ fbuilderjQuery.getJSON( 'https://api.metalpriceapi.com/v1/latest?api_key=[API_KEY]&base=USD¤cies=EUR,XAU,XAG', function(data){ fbuilderjQuery('[id*="fieldname3_"]').val(1/data['rates']['XAU']); ENABLEEQUATIONS(jQuery('[id*="cp_calculatedfieldsf_pform_"]')); EVALEQUATIONS(jQuery('[id*="cp_calculatedfieldsf_pform_"]')); }); } }); </script>
Thank You again!
Forum: Plugins
In reply to: [Calculated Fields Form] Validation or dependencies for next buttonThank You again!
Can i use a range too? (ie. from ABC100 to ABC200)
Another problem is that this cff-gotopage event is triggered when i press the next button even if the required field is wrong: cff-gotopage
Forum: Plugins
In reply to: [Calculated Fields Form] Validation or dependencies for next buttonThanks!
Does it work with multiple codes? (Ie. ABC123 or ABC234 or ABC345)
Forum: Plugins
In reply to: [Calculated Fields Form] Delay for calculated fields?Superb! Thank You very much!
Forum: Plugins
In reply to: [Calculated Fields Form] Delay for calculated fields?Hi,
unfortunately it doesn’t work (or i made some error):
<script> fbuilderjQuery(document).one('cff-gotopage', function(){ fbuilderjQuery(document).one('showHideDepEvent', function(){ fbuilderjQuery.getJSON( 'https://api.metalpriceapi.com/v1/latest?api_key=[API_KEY]&base=USD¤cies=EUR,XAU,XAG', function(data){fbuilderjQuery('[id*="fieldname3_"]').val(1/data['rates']['XAU']);} ); }); }); </script>
I put this code on a html content field, tried on both pages, but no success.
What am I doing wrong?
Forum: Plugins
In reply to: [Calculated Fields Form] Delay for calculated fields?Where shall i write this code?
One more question:
i’ve created a multi-page form and have put that shortcode with the external api request to the second page. But it is executed right when i load the form.
How can I make it to execute that shortcode only when i am on the second page?Thank You again!
Hi Patrick,
unfortunately i cannot follow you.
I don’t have a “calculation-1-field” – is that the html field which displays the shortcode’s value?
What formula should i put in the “calculation-1” element? Without a formula a cannot add that field.
How do i change the “15*1” to my shortcode value if i don’t know the value, because it will received via that shortcode? Or should i put my shortcode here?I’m sorry I don’t understand.
Thanks for the information!
Forum: Plugins
In reply to: [Calculated Fields Form] Delay for calculated fields?Hi,
thank You for the answer, it works.
Is it possible to achieve the same without a button? (ie. with some delay?)