Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I've created this template page, been trying to get custom subjects to the drop-down. Also how can I highlight the subjects of if i select main on the backend.

Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Inquiry Form'>
    <cms:repeatable name="form" label="." order='1'>
        <cms:editable name="subject" label="Subject" type="text"/>
        <cms:editable name="type" type="dropdown" label="Type" opt_values='main=main | normal=normal'/>
    </cms:repeatable>
</cms:template>
<?php COUCH::invoke(); ?>


View page
Code: Select all
<cms:form method="post" class="form-inline">
    <div class="gff-input col-md-3">
        <cms:input type="text" name="name" class="form-control gff-input" id="nameInput" placeholder="Name" />
    </div>
    <div class="gff-input col-md-3">
        <cms:input type="text" name="email" class="form-control gff-input" id="emailInput" placeholder="Email" />
    </div>
    <div class="gff-input col-md-3">
        <cms:input type="text" name="phone" class="form-control gff-input" id="phoneInput" placeholder="Phone no." />
    </div>
    <div class="gff-input col-md-3">
    <cms:pages masterpage='inquiry.php'>
        <cms:input type="dropdown" name="subject" lable='Subject' class="form-control"
        opt_values="<cms:get_custom_field 'form' masterpage='inquiry.php' />" style="width: 100% !important; border: 1px #3d9dfd solid;" />     
     </cms:pages>     
    </div>
    <div class="clearfix"></div>
    <div class="gff-textarea col-md-12" style="margin-bottom: 25px;">
        <cms:input type='textarea' name="message" class="form-control" rows="3" style="width: 100%; border: 1px #3d9dfd solid;" placeholder="Write us"></cms:input>
        <button type="submit" class="btn btn-default gff-send-btn">Send<span class="glyphicon glyphicon-arrow-up gff-glyph" aria-hidden="true"></span><cms:input name="submit" type="submit" class="couchbtn"/></button>

        <cms:if k_success >
        <h4>Thanks for your submission. We'll get back to you.</h4>
        <cms:send_mail from='info@sender.com' to='reciever@gmail.com' subject='Inquiry from your site'>
            The following is an email sent by a visitor to your site:
            <cms:show k_success />
        </cms:send_mail>
    </cms:if>

    </div>
</cms:form>


on the front end I see the drop down like this. cant get the value to show on the drop down
Screen Shot 2017-07-18 at 2.30.54 AM.png
Screen Shot 2017-07-18 at 2.30.54 AM.png (14.38 KiB) Viewed 220 times
Please read the documentation pertaining to repeatable regions:

Core Concepts - Repeatable Regions

Specifically you need to read the second half regarding displaying repeatables via the show_repeatable tag.
Image
2 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests