Hi All,
I have create a webform where I'll get 10 inputs for the customer and want to make first 5 input fields to be mandetory and other 5 is optional.
I'm trying to do with a-ttf-class but is not working.
can anyone help me on this?
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
Please try this one...
t-attf-class="form-control {{ 'required' if i <= 5 else '' }}"
Thanks & Regards
Not working
I'm asking v17
I have tried it in v17
this above is for only adding your class "clsrequired" for first 5 field
if you want to add required attribute for first 5 field then you have to try below code
                  <t t-if="i <= 5">
                        <div class="form-group">
                            <input type="text" t-attf-id="field_#{i}" 
                                   class="form-control" 
                                   required="1"/>
                        </div>
                    </t>
                    <t t-else="">
                        <div class="form-group">
                            <input type="text" t-attf-id="field_#{i}" 
                                   class="form-control"/>
                        </div>
                    </t>
Thanks & regards
Thanks Yatrik
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati| Post correlati | Risposte | Visualizzazioni | Attività | |
|---|---|---|---|---|
|  | 0 gen 22  | 2871 | ||
|  | 1 mar 25  | 2414 | ||
|  | 0 nov 24  | 2251 | ||
|  | 0 giu 24  | 2088 | ||
|  | 1 giu 24  | 2657 | 
