• Resolved radu88

    (@radu88)


    Hey!

    So, again, thanks for all the help so far. Please see here for current setup explained (in a previous post you assisted us).

    We tweaked our form to have a metric / imperial selection. The problem is that once the user clicks “Calculate” button, the text that is displayed has the correct values, but has the word “lbs” that we would like to change to “kg” if the metric selection is used.

    At his stage, our output field looks like this

    jQuery('#result-here-lbs').html('In '+fieldname8+' water, with '+fieldname7+' and '+fieldname9+' tank you will need apparently '+fieldname14+' lbs');

    Our metric / imperial selection is fieldname23, how can we update the output so the last word in the output is lbs or kg depending on the value selected?

    We tried something like this

    jQuery('#result-here').html
    if(fieldname23 == 'Imperial') return ('In '+fieldname8+' water, with '+fieldname7+' and '+fieldname9+' tank you will need apparently '+fieldname14+' lbs');
    
    jQuery('#result-here').html
    if(fieldname23 == 'Metric') return ('In '+fieldname8+' water, with '+fieldname7+' and '+fieldname9+' tank you will need apparently '+fieldname14+' kg');

    Any help is greatly appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @radu88

    Please, send me the URL to the page where the form is inserted to check it in detail.

    Best regards.

    Thread Starter radu88

    (@radu88)

    hey @codepeople, it’s here and the password to view the page is 2020

    Thank you!

    Plugin Author codepeople

    (@codepeople)

    Hello @radu88

    The code would be similar to:

    
    jQuery('#result-here').html('In '+fieldname8+' water, with '+fieldname7+' and '+fieldname9+' tank you will need apparently '+fieldname14+' '+IF(fieldname23 == 'Imperial', 'lbs', 'kg'));
    

    Best regards.

    Thread Starter radu88

    (@radu88)

    This is exactly what I was looking for, thank you so much!

    Hi. I am creating a thank you page that will display a bunch of the field names and values from my form. Generally, all good but how do I output the option name of the selected checkbox in a checkbox field?

    Thanks

    Jamie

    Plugin Author codepeople

    (@codepeople)

    Hello @morphpr

    Select the “Choice Text” option for the “Value to Submit” attribute in the settings of the checkbox field.

    Best regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change text in output depending of fieldname selection’ is closed to new replies.