DHTMLX Docs & Samples Explorer

setRequired(name, value, state)

makes/unmakes a certain field required

Parameters:

  • name - the id of item (the item's parameter 'name')
  • value - the value of a radio button ( the radio's parameter 'value'). Required for 'radio' items only
  • state - to make the field required, set the parameter to true. Otherwise, false
myForm.setRequired("prj_name",true); //makes the input with the name 'prj_name' required