Calculated field will only display numbers and ignore letters

[ad_1]

Hi,

I have a calculator that consists first of a radio select field (fieldname59) where the user can select “Menu 1 or 2” or “Menu 3”.
Then, depending on the url parameter “guests”, two other fields (fieldname52 and fieldname53) display a value that consists of letters, special characters, numbers, and spaces.
The third step would be for a new field (fieldname57) to show the value of fieldname52 or fieldname53 depending if the user chose “Menu 1 or 2” or “Menu 3” on fieldname59.
I used a calculated field with the following code for fieldname57:

(function(){
var result = ”;
if(fieldname59==1) result = fieldname52;
if(fieldname59==3) result = fieldname53;
jQuery(‘.userselection’).html(result);
return result;
})()

However, the calculated field will only display the numbers of fieldname52 and fieldname53 and ignore everything else.

What am I doing wrong?

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer