Change text in output depending of fieldname selection
-
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!
- The topic ‘Change text in output depending of fieldname selection’ is closed to new replies.