How to get the id of an input created by jsonform?

1

Personal how do I get the id of an input created from a Json with the Jsonforms documentation plugin here. It uses Schemas and Forms to mount the html dynamically, but I am not able to work with the input ids, I need to validate the fields with the blur event. Here is an example of a schema created:

 function getSchemaNFI(dataMap) {

 var formObject = {
   "schema": {
     "RazaoSocialDoTomador": {
        "type": "string",
        "title": "Razão Social do Tomador"
    }
 },

 "form": [
     {
        "type": "fieldset",
        "title": "Tomador",
        "items": [            
          "RazaoSocialDoTomador"
        ]
    }
 ],

"value": {
    "RazaoSocialDoFornecedor": getFromDataMap("RazaoSocialDoFornecedor", dataMap),
}

  "params": {
    "fieldHtmlClass": "input-text"
  }
};

return formObject;
}
    
asked by anonymous 31.01.2018 / 17:09

1 answer

0

Next, for you to get the id of ANY element .... just use the ATTR function of jquery example

$("input").blur(function() {

console.log($(this).attr('id'));

});
    
31.01.2018 / 19:42