Title: Hide script in html content or do shortcode
Last modified: June 24, 2022

---

# Hide script in html content or do shortcode

 *  Resolved [peti73](https://wordpress.org/support/users/peti73/)
 * (@peti73)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/)
 * Hi,
 * i’ve made an API-call within a “HTML Content” field with your help:
 *     ```
       <script>
       fbuilderjQuery(document).one('cff-gotopage', function(){
           fbuilderjQuery.getJSON( 'https://api.metalpriceapi.com/v1/latest?api_key=[API_KEY]&base=USD&currencies=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>
       ```
   
 * My problem is that **my API-KEY is visible** in the browsers element inspector
   with the whole script.
    Is there a method to HIDE this?
 * A workaround could be to run this shortcode in a field: [metalpriceapi price_round
   =”2″]. Is that possible?
 * Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/#post-15769092)
 * Hello [@peti73](https://wordpress.org/support/users/peti73/)
 * There are some alternatives:
 * You can insert the shortcode you are referring to directly into the page and 
   use the resulting code from the form.
 * What is the resulting code from inserting the `[metalpriceapi price_round="2"]`
   shortcode?
 * Or you can enable the SERVER_SIDE Equations add-on (Distributed with the Developer
   and Platinum versions of the plugin) and call it from the calculated field in
   the form:
 * [https://cff.dwbooster.com/blog/2018/10/01/server-side-equations](https://cff.dwbooster.com/blog/2018/10/01/server-side-equations)
 * Best regards.
 *  Thread Starter [peti73](https://wordpress.org/support/users/peti73/)
 * (@peti73)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/#post-15769872)
 * Hi,
 * `[metalpriceapi price_round="2"]` shortcode just gives a number, the actual price.
   
   Ie. `1872.11`
 * Can i insert that shortcode in a field?
 * Thanks!
 *  Thread Starter [peti73](https://wordpress.org/support/users/peti73/)
 * (@peti73)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/#post-15770175)
 * < code > 1872.11 < /code >
    (without the spaces)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/#post-15770463)
 * Hello [@peti73](https://wordpress.org/support/users/peti73/)
 * In this case, you can insert the shortcode into a span tag with an unique id:
 * `<span id="my_number">[metalpriceapi price_round="2"]</span>`
 * And then, insert a calculated field in the form, and enter the following equation
   through its settings:
 * `jQuery('#my_number').text();`
 * Now, the calculated field has the number generated by the shortcode.
 * Best regards.
 *  Thread Starter [peti73](https://wordpress.org/support/users/peti73/)
 * (@peti73)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/#post-15770768)
 * Well, 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.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hide script in html content or do shortcode’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [api key](https://wordpress.org/support/topic-tag/api-key/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 5 replies
 * 2 participants
 * Last reply from: [peti73](https://wordpress.org/support/users/peti73/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/hide-script-in-html-content-or-do-shortcode/#post-15770768)
 * Status: resolved