Greetings @KK Sir and @ All!

I have a quotation template. This is used to generate quotations.

I have a conditional field in this template. This field allows the user to select a a customer. There can b two types of customers, viz.:
1. Existing
2. New

For an existing customer there is a relational dropdown. It fetches the data of the existing customer through AJAX and display the customers data.

I also want to give the user the option to create a new customer from here itself. So using the conditional field the user selects "New" Customer and that show the fields for adding the new customer which will be filled in by the user and then when quotation is submitted the customer can be created with the help of db_persist tag.

The issue i am facing is with the conditional field. The field is defined as:
Code: Select all
<cms:editable name="customer_type" label="Customer Type" type="dropdown" opt_values="Select =- | Existing | New" opt_selected="-" order="1" />
   
    <cms:func _into='cond_customer_type' customer_type=''>
        <cms:if customer_type = 'Existing'>
            show
        <cms:else />
            hide
        </cms:if>
    </cms:func>
    <cms:editable name="quotation_for_client" label="Quotation for Client" type="relation" has="one" masterpage="customers/customer.php" not_active=cond_customer_type order="2" />

    <cms:func _into="cond_customer_type" customer_type=''>
        <cms:if customer_type = 'New'>
            show
        <cms:else />
            hide
        </cms:if>
    </cms:func>
    <cms:editable name="new_client_name" label="New Client" type="text" not_active=cond_customer_type />


and the front end is defined as:
Code: Select all
<div class="col-md-7 col-sm-7 col-xs-7">
                                <cms:input name='customer_type' type='bound' class="form-control input-sm" />
                            </div>
                           
                            <!-- Existing Customer -->
                            <div id="k_element_quotation_for_client">
                                <div class="col-md-4 col-sm-4 col-xs-4">
                                    Customer Name
                                </div>
                                <div class="-col-md-1 col-sm-1 col-xs-1">
                                    :
                                </div>
                                <div class="col-md-7 col-sm-7 col-sm-7">
                                    <cms:input name='quotation_for_client' type='bound' />
                                </div>
                                <div class="col-md-12 col-sm-12 col-sm-12">
                                    <div class="text-uppercase" id="c_billing_address"></div>
                                    <div class="gxcpl-potp-5"></div>
                                    <div class="text-uppercase" id="c_gst"></div>
                                    <div class="gxcpl-potp-5"></div>
                                    <div class="text-uppercase" id="c_number"></div>
                                    <div class="gxcpl-potp-5"></div>
                                    <div class="text-uppercase" id="c_email"></div>
                                </div>
                            </div>
                            <!-- Existing Customer -->

                            <!-- New Customer -->
                            <div id="k_element_new_client_name">
                                New Customer
                            </div>
                            <!-- New Customer -->


The problem is that the content of "k_element_new_client_name" is always displayed. How can i display it only when the "customer_type" editable has the value "New"?

Regards,
GenXCoders (Priya)