Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2255 มุมมอง

hi all,

in below code i want to have another field " active " with <option t-esc="zone.name" how it can be done with its Display value  like:  value stored in db is " active " the display value is " Active " when user click in it to select a Zone, it should display zone + active as below:

ZoneNameA....[ Active ]

ZoneNameB....[ InActive ]

etc.

                <div class="form-group field-zone_id">
                    <label for="zone_id" class="control-label">Your Zone</label>
                    <select name="zone_id" class="form-control link-style">
                        <t t-foreach="zone_rec" t-as="zone">
                            <option t-esc="zone.name" t-att-value="zone.id"/>
                        </t>
                    </select>
                </div>

regards

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

it has been done, modified code is here ( refer to my question above for the line modified )

                <div class="form-group field-zone_id">

                    <label for="zone_id" class="control-label">Your Zone</label>

                    <select name="zone_id" class="form-control link-style">

                        <t t-foreach="zone_rec" t-as="zone">

                            <option t-esc="zone.name+'--'+zone.zone_status.title()" t-att-value="zone.id"/>

                        </t>

                    </select>

                </div>


Don't know why I it is not showing code or quote for code i pasted here...

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 21
2525
1
ก.พ. 25
3623
2
เม.ย. 23
2866
2
ก.พ. 25
40631
2
พ.ย. 22
2908