Get Element Id From Generated By Using HtmlForm Template

Hello Webix Team,

I wanna ask about the method (webix side) to get the id of html element that generated by htmlform in webix. When we define the template of form by using htmlform, I realize that webix generate the html id of the component in random number. For example the htmlform template include label "Name" and its own input text. I found that the id of the input text of "Name" is in random number, for example (152938271718). I need to know this in order to make a modification of some form element (in this case the input text element) on the fly, for example add placeholder, pattern, etc. Because adding additional properties by using id of webix component (in this case id = "name") is not working. It is only working when I add it at the id of the html (in this case id = "152938271718"). So, is there any webix method to do it (for now I'm using the document.getElementById method which I expect will not reliable).

Thank you very much

Comments

  • Hello,

    In Webix htmlform, elements are available by their name attribute as follows:

    $$("formView").elements["name_attr"]
    

    Please check: https://snippet.webix.com/x6b5ckcy

    Also, could you please provide an example of your implementation? By default, htmlform does not add any id to the nested html controls (you can modify the above snippet to test this behaviour).

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion