This question has been flagged
3139 Views

i would like to chage the placeholder name when click something....let me show you.

First :

<field name="name" default_focus="1" placeholder="Name" />

then i change  like the following.

<xpath expr="//form/sheet/div/h1/field[@name='name']" position="attributes">
                    <attribute name="placeholder" attrs="{'invisible': ['&amp;', ('is_company', '=', False), ('supplier', '=', False)]}">[Something]</attribute>
                </xpath>

 

At that time, i like to click the company's checkbox, change the original one.

<field name="name" default_focus="1" placeholder="Name" />

 

 

what am i doing like the above case?

 

Avatar
Discard

I don't have enough insight to answer how you can implement dynamic placeholder as you have states, but the <attribute tag can only contain "name" attribute and nothing else (cannot contain "attrs")