• There was a thread about this already but it doesn’t work for me so I decided to make a new thread in hopes that it could be better explained.
    https://wordpress.org/support/topic/insert-fieldname-value-in-html-content?replies=5#post-8152807

    I want to select specific fields in my “Calculated Fields Plugin” form and place them in a textbox or div of some sort. I have a table in my HTML as follows:

    <table>
      <tr>
        <td>My field label</td>
        <td id="f1"></td>
      </tr>
    </table>

    I have placed this function inside “Calculated Fields Form” set equation area:

    (function(){
    jQuery( '#f1' ).html(fieldname1);
    })()

    My problem is, it doesn’t recognize any of the fieldnames. I have tried different fieldnames in my form and it doesn’t work. Placing a constant string such as “hello” works fine. There are values written on these fields so this should not be returning NULL values.

    Any help on this would be appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Could you send me the link to the form, to check its settings in detail, please?

    The code you have posted seem to be correct, but I need to check the form’s settings, and the fields on it.

    Best regards.

    Thread Starter spigen604

    (@spigen604)

    The site is still locally hosted at the moment. I’m glad to know the structure of the equation is correct so I can focus on debugging other parts.

    I can show you the images over here: http://imgur.com/a/kJBoF

    The first image is the field in question that I want to insert into another form/div/textbox.

    The second image is the “submit button” that contains the jquery function for insertion.

    Hi,

    Thank you very much, I’ve detected the issue from the screenshots. The structure fieldname# to get the values of fields is only valid into the equations associated to the calculated fields but not in the onclick events of the buttons. Please, follows the steps below:

    1. In the first screenshot (the attributes of the fieldname35 field), enter the class name: myfield in the attribute: “Add CSS Layout Keywords”

    2. Replace the onclick event of the button as follows:

    jQuery('#f1').html(jQuery('.myfield input').val());

    If the #f1 field is an input field the correct code would be:

    jQuery('#f1').val(jQuery('.myfield input').val());

    and that’s all.
    Best regards.

    Thread Starter spigen604

    (@spigen604)

    It works fine now. Thank you very much for your help!

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

The topic ‘[Plugin: Calculated Fields Form] Fieldname value into another form’ is closed to new replies.