NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on March 14, 2025, 01:15:42 AM
-
Hi
I'm trying to place a button on the header on a form.
Allow xHTML is on
Allow UNSAFE xHTML is on
I can place a button without any problems but when I add the attribute onclick="onclick="$(''.help-click'').click()"" it fails. Does it have anything to do with the fact that "onclick" is SUPER UNSAFE?
Example attached.
Regards Niels
-
I had no success try to make this work. I recommend an alternative approach - like setting a data- attribute on the button then attaching JavaScript to that attribute in your custom javascript file.
-
Thanks Bruce,
it works fine when I add the code in the console
$('.help-button').click(function(){
alert($(this).attr('data-button'));
});
But I'm very unsure where to insert my script.
I've tried all sorts of places. In the index page, in the header, but nothing really comes through or it lands in the wrong place.
Can you guide me in the right direction?
-
not really. I had no success making this work.