Title: HTML Content
Last modified: January 25, 2018

---

# HTML Content

 *  Resolved [Goran](https://wordpress.org/support/users/hrvan/)
 * (@hrvan)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/)
 * Hi there.
    I’m using HTML Content to add a button to download PDF but now I realized
   that PDF differs from package to package. The code I’m using inside is: <div 
   class=”cff_button_div”><i class=”fa fa-file-pdf-o”></i> PDF</div> Link to pdf
   we use is saved inside ACF field, and I have the package id inside fieldname2.
   So I can target ACF dependent on that fieldname. Can you help me with the equation?
   Please 🙂

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9902993)
 * Hello [@hrvan](https://wordpress.org/support/users/hrvan/),
 * I’m sorry, but I don’t know what do you mean with ACF field. I don’t understand
   the structure of your form and fields.
 * Best regards.
 *  Thread Starter [Goran](https://wordpress.org/support/users/hrvan/)
 * (@hrvan)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9904668)
 * By ACF I mean advanced custom fields. They are stored in table wp_postmeta. I’m
   importing a lot of data in this form with them but now I need to find a solution
   for this button. Any ideas?
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9905121)
 * Hello [@hrvan](https://wordpress.org/support/users/hrvan/),
 * If you need pre-fill some fields with data stored in the wp_postemta table, the
   correct would be use the set of “DS” fields (the “DS” fields are distributed 
   with the Developer and Platinum versions of the plugin, they read their values
   from external data-sources like a database or CSV file).
 * For example, assuming you have a custom field called: my-field, and you want 
   use its value into the form whose id=1
 * – First add a new attributed in the forms shortcode passing the id of post:
 * `[CP_CALCULATED_FIELDS id="1" current_post="123"]`
 * Note: all attributes defined through the form’s shortcode different to id, are
   converted in javascript variables with global scope, so, the previous shortcode
   creates in the page the javascript variable current_post with the post id, in
   this case the 123
 * – Now, insert for example a “Line Text DS” field, select the database as the 
   datasource to use, and enter as the query to populate the field:
 *     ```
       SELECT meta_value as value FROM {wpdb.postmeta} WHERE meta_key="my-field" AND post_id=<%current_post%>
       ```
   
 * and that’s all, the field will be filled with the value entered through the custom
   field: my-field, read directly from the database.
 * Additional details in the following links:
 * [https://cff.dwbooster.com/documentation#datasource-fields](https://cff.dwbooster.com/documentation#datasource-fields)
   
   [https://cff.dwbooster.com/documentation#datasource-fields-settings](https://cff.dwbooster.com/documentation#datasource-fields-settings)
 * Best regards.
 *  Thread Starter [Goran](https://wordpress.org/support/users/hrvan/)
 * (@hrvan)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9905343)
 * Hello.
    This is how I was using it before for any other occasions. But the thing
   is this needed to be a button I can click. If I use an Line Text DS for this 
   is it possible it can be clicked? I don’t think so… Through ACF I’m parsing the
   link to a PDF like [http://www.somewebsite.com/images/somepdf.pdf](http://www.somewebsite.com/images/somepdf.pdf)
   I’m using this on my packages, and I would like to pass this inside CFF. If I
   somehow can trigger Line Text DS over the class or something this wouldn’t be
   a problem for me to design it latter with css.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9905575)
 * Hello,
 * If you are populating a “hidden DS” field with the absolute URL to the PDF file(
   [http://&#8230](http://&#8230);), for example, assuming it is the fieldname1 
   field, the code to enter as the onclick event of the button, would be as simple
   as:
 *     ```
       window.open(jQuery('[id*="fieldname1_"]').val());
       ```
   
 * I’m sorry, but this question is not related directly with our plugin, it is a
   general question of javascript. If you need additional help implementing your
   project I can offer you a custom coding service from my private website:
 * [https://cff.dwbooster.com/customization](https://cff.dwbooster.com/customization)
 * Best regards.
 *  Thread Starter [Goran](https://wordpress.org/support/users/hrvan/)
 * (@hrvan)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9905951)
 * Thanks indeed!

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

The topic ‘HTML Content’ 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

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [html content](https://wordpress.org/support/topic-tag/html-content/)

 * 6 replies
 * 2 participants
 * Last reply from: [Goran](https://wordpress.org/support/users/hrvan/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/html-content/#post-9905951)
 * Status: resolved