How to create default radio button website, I want to set default in radio button on morning in my website.<template id="fal_shift_opt" inherit_id="website_sale.payment" customize_show="True" name="Shift Option"> <xpath expr="//div[@id='delivery_carrier']" position="before"> <div class="row" id="shift_option"> <div class="col-lg-7 col-sm-8"> <h4>Choose your shift delivery</h4> <ul class="list-unstyled"> <li> <label> <input value="morning" type="radio" name="shift2" t-att-checked="order.shift2 == 'morning' and 'checked' or False" /> <span>Morning</span> </label> </li> <li> <label> <input value="afternoon" type="radio" name="shift2" t-att-checked="order.shift2 == 'afternoon' and 'checked' or False" /> <span>Afternoon</span> </label> </li> </ul> </div> </div> </xpath> </template>
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
Bootstrap does the trick!! :-)
https://www.w3schools.com/bootstrap/bootstrap_forms_inputs.asp
The code is sort of correct. Add a proper ending " />" and for the SELECTED feature, use selected= "1".
Also, in this sample code there is no actually value send but I believe it would be possible to use value="123xyz" just as one would think....!
hello
you have to do code like this.
for eg.
<input value="morning" type="radio" name="shift2"
t-att-checked="'checked' if order.shift2 == 'morning' else None"
/>
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden