Technical mailing list archives

javascript inside <form> element of form view

Maxim Litnitskiy
- 09/21/2014 09:23:45
Hi dear Experts!
Can some one give a clue why the following works:

            <form string='Campaign' edit='1'>
                <script type='text/javascript'>

and the following does not work:

            <form string='Campaign' edit='1'>
                <script type='text/javascript'>


I am trying to add functionality to hide / show edit / create / delete buttons of form view based on conditions.
As far as I understood we cannot do it directly as first xml arch is loaded and then it is populated with fields data.
So we cannot do smth like <form string='Campaign' attrs="{'edit': [('state', '=', 'can_edit')]}"/>.
So I thought I can do it why JQuery after load.
Seems not?