Disable the field B when field A is filled

Hi everyone ;
I have One Module that contain 2 fields:

  • Rate
  • Amount

My need :
I have to fill ONE of the fields, not both at once.
- The rate OR - Amount like that

How can i proceed to solve this issue,
Im waiting ur suggestions, and thank u for ur help

Hi dpccrt87,

This would require custom javascript to be added to the page which would disable one of the fields when the other has content.


Thank u for ur reply Mr LAN ;
But if possible , can u explain me more, how can i proceed ?

Hi dpccrt87,

To get you started you could have a look at this blog post. it shows you how to add javascript to a editview page.


from here its just using traditional javascript to add the logic to disable the field when the user interacts with the other.


Thank u very much :wink:

Its done

$("#rem_taux_c").keyup(function() {
if($("#rem_taux_c").val().trim() == “”){


$("#rem_forfait_c").keyup(function() {
    if($("#rem_forfait_c").val().trim() == ""){