Hello All, @KK Sir, @trendoman,
I am trying to same the id/name/title of a relation field as the k_page_title of a DBF with _auto_title='0'.
Is there a straight forward method for the same that I am missing out?
Here is a small sample code to make the picture clear!
It would be
where the k_page_title is set to id/name/title_text.
For example:
Relational Field has values: Type A, Type B
Text Field can take any user entered value.
so the DBF title should be:
1. Type A_text or Type B_text
or
2. type-a_text or type-b_text
or
3. using id (if Type A has id 1 and Type B has id 2)
1_text or 2_text
Please help!
Regards,
GenXCoders (Priya)
I am trying to same the id/name/title of a relation field as the k_page_title of a DBF with _auto_title='0'.
Is there a straight forward method for the same that I am missing out?
Here is a small sample code to make the picture clear!
- Code: Select all
<?php require_once('../couch/cms.php'); ?>
<cms:template title="Save Relation Id" clonable="1">
<cms:editable name="rel_district" label="District Relation" type="relation" has="one" masterpage="district/names.php" required="1" order="1" />
<cms:editable name="text" label="Text" type="text" required="1" order="2" />
</cms:template>
<cms:set submit_success="<cms:get_flash 'submit_success' />" />
<cms:if submit_success >
<h4>Success: Your application has been submitted.</h4>
</cms:if>
<cms:form
masterpage=k_template_name
mode='create'
enctype='multipart/form-data'
method='post'
anchor='0'
>
<cms:if k_success >
<cms:db_persist_form
_invalidate_cache='0'
_auto_title='0'
k_page_title="<cms:pages masterpage='test/save_relation.php' ><cms:related_pages 'rel_district' page_title='<cms:show frm_rel_district />' limit='1'><cms:show district /></cms:related_pages></cms:pages>_<cms:show frm_text />"
/>
<cms:if k_success>
<cms:set_flash name='submit_success' value='1' />
<cms:redirect k_page_link />
</cms:if>
</cms:if>
<cms:if k_error >
<div class="error">
<cms:each k_error >
<br><cms:show item />
</cms:each>
</div>
</cms:if>
<label>District</label>
<cms:input name="rel_district" type="bound" />
<br />
<label>Text</label>
<cms:input name="text" type="bound" />
<br />
<button type="submit">Submit Application</button>
</cms:form>
<?php COUCH::invoke(); ?>
It would be
- Code: Select all
k_page_title="<cms:pages masterpage='test/save_relation.php' ><cms:related_pages 'rel_district' page_title='<cms:show frm_rel_district />' limit='1'><cms:show district /></cms:related_pages></cms:pages>"
where the k_page_title is set to id/name/title_text.
For example:
Relational Field has values: Type A, Type B
Text Field can take any user entered value.
so the DBF title should be:
1. Type A_text or Type B_text
or
2. type-a_text or type-b_text
or
3. using id (if Type A has id 1 and Type B has id 2)
1_text or 2_text
Please help!
Regards,
GenXCoders (Priya)