It is possible to get the value from an element outside of the actual form. In order to do this, we need an input element with an individual selector like an ID or a class:
The input field’s ID is coffee, so the selector can be:
#coffee
or
.class-coffee
Please keep in mind that if there are multiple elements with the same selector, the plugin may not be able to retrieve the correct value. Read more about CSS selectors on MDN web docs.
Next, open up the element in the form editor, look for the option called Value_external and enter the selector there. If you want the element to listen to any changes on the target selector, set the option Value_external_listen to Yes.
Example
Input field (#coffee)
Form
Loading...
Retrieve value from GET parameter
With ez Form Calculator, you can also retrieve values from a URL parameter. Example:
http://yoururl.com/page?id=123
In order to retrieve the value of the id-parameter, open up the element in the form editor, look for the option called GET and enter the relevant parameter there (id in this case).
Retrieve value from an external URL
If your webserver supports cURL or allow_url_fopen is enabled, you can get the value of an external page to be included in the form. Let’s say the URL you want to retrieve the value from returns a number or a string. Find the element option Value_http and simply enter the URL there.
The plugin is also able to parse a JSON request. Example URL: https://www.bitstamp.net/api/v2/ticker/btcusd/
When you open the URL, you will see a string in the JSON data format. The element option Value_http_json parses the returned JSON string and you are able to select any key within. If the JSON string contains multiple objects, you can access an object’s key via a dot, e.g.: myobject.key.anotherkey
By continuing to use the site, you agree to the use of cookies. more information
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.