Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
hello all, I'm scratching my head on this one and I can't see that I've made a daft error (which does happen :shock: ) - despite having looked and looked at this. I have a text editable field which is conditional and when I enter a value and save, the field blanks out. I stripped back to the relevant editable regions and created a new template called test2.php and the issue remains. I would appreciate anyone being able to spot what is going in here. THe problem editable is named 'events_label'. Thanks. :?

Code: Select all
<?php require_once( 'admin/cms.php' ); ?>
<cms:template title='TEST2' clonable='1' hidden='0'  icon='sun' commentable='0' order='35' >
     
<cms:editable type='radio' name="more_details" label="Add more course details?" desc='for display on a full course details page' opt_values='No=no | Yes=yes' opt_selected='no'  order='50' /> 
 
<cms:func _into='more_cond' more_details=''>
    <cms:if more_details='yes'>       
    show
    <cms:else />       
    hide       
    </cms:if>
</cms:func>   
   
       
    <cms:editable type='radio' name="select_layout" label="Select layout for these extra course details" opt_values='Tabbed content=tabbed_layout |Simple list=list_layout' opt_selected='tabbed_layout'  order='95' not_active=more_cond /> 

    <cms:editable type='text' label='Link text from the listing page to the course details page' desc='e.g. full details' name='details_link_text'   order='100' not_active=more_cond />   

           
<cms:editable type='radio' name='course_events' label='Does this course have any associated events?' desc='for display on a full course details page' opt_values='No=no | Yes=yes' opt_selected='no'  order='200'  not_active=more_cond/> 
 
    <cms:func _into='my_cond' more_details='' course_events=''>
        <cms:if
            "<cms:is 'yes' in=more_details />"
            &&
            "<cms:is 'yes' in=course_events />"
        >
            show
        <cms:else />
            hide
        </cms:if>
    </cms:func>

           <cms:editable name='events_label' label='Title for these events - used for the tab heading' desc='e.g. concerts' type='text'   order="219" not_active=my_cond />   
                 
                                 

</cms:template>
<?php COUCH::invoke(); ?>
Hi,

The syntax you used for checking values works exclusively for type 'checkbox' (because it can potentially contain multiple selected values).

So instead of the current -
Code: Select all
<cms:if 
    "<cms:is 'yes' in=more_details />"
    &&
    "<cms:is 'yes' in=course_events />"
>

.. please use the following for your type 'radio' fields -
Code: Select all
<cms:if more_details = 'yes' && course_events = 'yes'>

Hope this helps.
belated thanks @KK for providing the answer to the problem!
You are welcome :)
4 posts Page 1 of 1