Conversation
supportI’ve found that you can set up fields, in a form, from URL parameters. The problem is that these become defaults and the table itself isn’t updated. Is there a way of setting the parameters, from the URL, and then actually get the table to calculate based on these ? I asked ChatGPT (yes, groan!) and it suggested the following code would work <script> document.addEventListener("DOMContentLoaded", function() { setTimeout(function() { if (typeof cff_calculate === "function") { cff_calculate(); } }, 300); }); </script> I’ve embeded this ojn my page and I’m finding that “if (typeof cff_calculate === “function”) {” is always faling and so the cff_calculate() function can’t be found. Is this the best way of setting vfalues, and then getting the form to update ? If no parameters are passed in then I want the form to await input before updating. The page I need help with: [ log in to see the link]
Hello @pompeypaul Yes, the code recommended by ChatGPT is incorrect, but that’s not the problem in form. First, in your fieldname2 settings, you ticked the option to use the default value as a placeholder. This mean the URL parameter will be assigned correctly to the field, but not as a value. Please select the fieldname2 and untick the option of using the default value as placeholder in its settings. Second, in fieldname6 you entered double dot as decimal symbol “..”. I suppose it is a typo. Please select the fieldname6 field in your form and fix the decimal symbol in its settings. Please let me know after editing your form to check the result. Best regards.
Magic, thank you for the amazingly quick response and it’s all working as needed now.
Hello @ If you have been satisfied with both the plugin and our support, we would be immensely grateful if you could leave us a review on the plugin ( https://wordpress.org/support/plugin/calculated-fields-form/reviews/ ). Your feedback will help us reach more users. Best regards.
Hello @pompeypaul Yes, the code recommended by ChatGPT is incorrect, but that’s not the problem in form. First, in your fieldname2 settings, you ticked the option to use the default value as a placeholder. This mean the URL parameter will be assigned correctly to the field, but not as a value. Please select the fieldname2 and untick the option of using the default value as placeholder in its settings. Second, in fieldname6 you entered double dot as decimal symbol “..”. I suppose it is a typo. Please select the fieldname6 field in your form and fix the decimal symbol in its settings. Please let me know after editing your form to check the result. Best regards.
Magic, thank you for the amazingly quick response and it’s all working as needed now.
Hello @ If you have been satisfied with both the plugin and our support, we would be immensely grateful if you could leave us a review on the plugin ( https://wordpress.org/support/plugin/calculated-fields-form/reviews/ ). Your feedback will help us reach more users. Best regards.