<p>Hi, I said the solution is working to the wrong question and I just realized the mistake. I still can't figure out to get the second solution to work. My question this time is slightly different from earlier as I would like to use Formidable Forms frm_currency filter rather than use external libraries / javascript. Wonder if that is possible?</p>
I'm under the impression that you may be new to WordPress Hooks. Please allow me to explain how filters work. Filters are PHP snippets that allow developers to use the WordPress Hooks API to change content and data either before or after a form paints in the browser. In general, they should not be used to support user interactions in a real time browser environment, unless there's no other way to resolve a specific design concept without making round trip data requests to the server.
Filters run on the server only while the form is being readied to be sent to an end user's browser OR after the submit button is pressed and the after submit entry management or navigation actions take place. After the form is painted in the browser, the filter is no longer available to you until the form is submitted or the browser is refreshed.
You asked if using the filter is possible. Yes, it's possible, but only if you use Ajax. Since the filter resides on the server only, each time a user changes the desired currency on the form entry, you must have a custom jQuery function to monitor the change and send the HTTP REQUEST to your server where your custom PHP callback function processes the information and in turn, transmits the RESPONSE back to the server to complete the request.
Creating the wrapper code to use a filter through Ajax to suit your requirement can only be solved through a custom programming solution and, unfortunately, it will not offer any value to a UX requirement that requires instant feedback to the end user. This is why I first suggested that you use the built-in browser library. It's ubiquitous and simple to implement. It still requires custom jQuery code, but with jQuery, you can find many examples on the web for what you want to do that are adaptable to Formidable Forms.
Hi
Thanks. You are right. Since filter is a server side script, it is not ideal to solve my problem.
Let me try out your earlier solution and see if I can implement them properly.
Cheers.
Please login or Register to submit your answer