Page 1 of 1

limit certain fields FIRST NAME to a single record and the others to unlimited.

Posted: 2018-06-21 17:24
by pasbonte
Hello
I would like to limit certain fields FIRST NAME to a single record and the others to unlimited.
Let me explain: I enter my NAME, my FIRST and it is blocked, the other fields remaining open.
It's possible ?

Re: limit certain fields FIRST NAME to a single record and the others to unlimited.

Posted: 2018-06-21 20:59
by pbottcher
Hi,

yes this is possible. You can do it by adding the following code to the hooks/<tablename>-dv.js (which you might need to create)

Code: Select all

$j(function () {

  if ($j('#YOURFIELDNAME1').val() != '') $j('#YOURFIELDNAME1').prop('readonly', true);
  if ($j('#YOURFIELDNAME2').val() != '') $j('#YOURFIELDNAME2').prop('readonly', true);

});