The 1C:Enterprise developers forum
Hi everyone,I'm creating an button in HTML by using JS and I want to assign this button with the event open a form. How can I do it? Thank you in advance! Duc Tien NGUYEN
Hi, Duc Tien NGUYEN, Where you generate this html view? In platform form, in email, web site or other?For example if you use mailing and using web publishing you can generate links likehttps://domain/infobase/#e1cib/data/Metadata.ElementName?ref=object_idfor example:https://domain/infobase/#e1cib/data/Catalog.Catalog1?ref=80fe00155d00050d11eaaa40c06233d0Path to object you can get by function "GetURL".
Hi, Bogdan Zuy,
Duc Tien NGUYEN, ok, so I think you use "HTML document field" and you can use OnClick event. For example,
<ht ml><body><button id=test>Open form</button></body></html>
If(EventData.Button.id = "test") Then OpenForm("Catalog.Catalog1.ObjectForm"); EndIf;
Bogdan Zuy, Thank you so much. It works perfectly.