• Resolved namazee

    (@namazee)


    Trying to resolve the following statement, it seems not working

    (function () {
    if (fieldname5 == “Guangzhou”)
    {
    if(IN(fieldname16,[“Kuala Lumpur”,”Selangor”])) return “RM410”;
    else if(IN(fieldname16,[“Pahang”,”Melaka”,”Negeri Sembilan”,”Perak”])) return “RM440”;
    else if(IN(fieldname16,[“Kelantan”,”Terengganu”,”Kedah”,”Perlis”,”Johor”,”Pulau Pinang”])) return “RM470”;
    else if(IN(fieldname16,[“Miri”,”Bintulu”,”Sibu”,”Kuching”])) return “RM520”;
    else if(IN(fieldname16,[“Ranau”,”Sandakan”,”Lahad Datu”,”Tawau”,”Papar”,”Beaufort”,”Sipitang”,”Kota Belud”,”Kota Tambunan”,”Kota Marudu”,”Kudat”])) return “RM560”;
    else if(IN(fieldname16,[“Saratok”,”Sarikei”])) return “RM560”;
    else if(fieldname16 == “Kota Kinabalu”) return “RM520”;
    else if(fieldname16 == “Labuan”) return “RM560”;
    }
    })()

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter namazee

    (@namazee)

    I’ve re-evaluate it many times but can’t seems to see whats wrong since its not displaying the value in my summary page

    Plugin Author codepeople

    (@codepeople)

    Hello @namazee,

    The code structure seems be correct, however, I cannot check it in action because the URL you sent me as reference, is displaying a wizard that indicates the website is not published yet, and I need to check the fields’ names and values in the form.

    Best regards.

    Thread Starter namazee

    (@namazee)

    Hi there,

    Im sorry, ive deactivated the maintenance mode.
    You will be able to access the site now

    Tqvm

    Plugin Author codepeople

    (@codepeople)

    Hello @namazee,

    The issue is simple, you are not using correct double quotes symbols in the equation, you are using other symbols that are not supported by javascript, you will understand it much better looking the following screenshot:

    Best regards.

    Thread Starter namazee

    (@namazee)

    Thank you very much.

    Thread Starter namazee

    (@namazee)

    As for the results (summarry page) is there any possibilities to add those summaries in a table form, or to display the result page on a particular page but in a table manner?

    Plugin Author codepeople

    (@codepeople)

    Hello @namazee,

    Yes of course, but in this case you should insert the fields by separated, using their own tags.

    For example, assuming you want to display the fields: fieldname1, fieldname2, and fieldname3 in the thank you page, with a table format, displaying their labels in the first column, and values in the second one, a possible solution would be insert the following piece of code into the content of the thank you page associated to the form:

    
    [CP_CALCULATED_FIELDS_RESULT]
    <table>
    <tr><td><%fieldname1_label%></td><td><%fieldname1_value%></td></tr>
    <tr><td><%fieldname2_label%></td><td><%fieldname2_value%></td></tr>
    <tr><td><%fieldname3_label%></td><td><%fieldname3_value%></td></tr>
    </table>
    [/CP_CALCULATED_FIELDS_RESULT]
    

    More information about the special tags to use in the thank you pages, visiting the following link:

    https://cff.dwbooster.com/documentation#special-tags

    Best regards.

    Thread Starter namazee

    (@namazee)

    Hi there,

    in regards to the table to display summary, there are three questions i would like to ask:

    1: is there possibility to have 4 column table to display like this = fieldname#_label,fieldname#_value,fieldname#_label,fieldname#_value

    2: By default, the table color is actually white and light grey, is there possibilities to change the grey to other color code?

    3: Within the table view, is there possibilities to have the fieldname#_label to be displayed in Bold Format
    http://factohub.com/business/summary/

    Thank you in advance.

    • This reply was modified 7 years, 5 months ago by namazee.
    Plugin Author codepeople

    (@codepeople)

    Hello @namazee,

    In the thank you page you can combine the HTML tags, fields’ tags and the CSS rules you want, for example:

    
    [CP_CALCULATED_FIELDS_RESULT]
    <table>
    <tr style="background:red;color:white;">
    <td><%fieldname1_label%></td>
    <td><%fieldname2_label%></td>
    <td><%fieldname3_label%></td>
    </tr>
    <tr>
    <td><%fieldname1_value%></td>
    <td><%fieldname2_value%></td>
    <td><%fieldname3_value%></td>
    </tr>
    </table>
    [/CP_CALCULATED_FIELDS_RESULT]
    

    Best regards.

    Thread Starter namazee

    (@namazee)

    Hi there,

    After implementing this code, it still seems to show the initial formatting which is tables in two column and the color remains the same which are (white and light grey)

    Please assist,
    Thank you

    Plugin Author codepeople

    (@codepeople)

    Hello,

    You have copied the code even with wrong double quote symbols, please, look the screenshot:

    I’ve edited the code at runtime directly in my browser, removing this symbols:

    Best regards.

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

The topic ‘If Statement not Working’ is closed to new replies.