Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Link onClick event of javascript with an event of 1C

Forum

Search UsersRules
Link onClick event of javascript with an event of 1C
#1
Active user
Points:: 0
Joined:: Oct 14, 2019

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

Profile
#2
Just came
Points:: 0
Joined:: Jun 9, 2020

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 like
https://domain/infobase/#e1cib/data/Metadata.ElementName?ref=object_id
for example:
https://domain/infobase/#e1cib/data/Catalog.Catalog1?ref=80fe00155d00050d11eaaa40c06233d0

Path to object you can get by function "GetURL".

Profile
#3
Active user
Points:: 0
Joined:: Oct 14, 2019

Hi, Bogdan Zuy,

Quote
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 like
https://domain/infobase/#e1cib/data/Metadata.ElementName?ref=object_id
for example:
https://domain/infobase/#e1cib/data/Catalog.Catalog1?ref=80fe00155d00050d11eaaa40c06233d0

Path to object you can get by function "GetURL".

I generate this html view in platform form.

Profile
#4
Just came
Points:: 0
Joined:: Jun 9, 2020

Duc Tien NGUYEN,

ok, so I think you use "HTML document field" and you can use OnClick event. For example,

Code
<ht ml><body><button id=test>Open form</button></body></html>


Code
If(EventData.Button.id = "test") Then
   OpenForm("Catalog.Catalog1.ObjectForm");
EndIf;

Profile
#5
Active user
Points:: 0
Joined:: Oct 14, 2019

Bogdan Zuy,

Thank you so much. It works perfectly.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.