Best replacement for <a href="javascript...." in HTML area?

Questions and answers for designing and implementing forms in Servoy

Best replacement for <a href="javascript...." in HTML area?

Postby drookwood » Wed Jul 04, 2018 11:29 am

So I'm finally moving from Servoy 5 to 8!!

In 5 I have been using...
Code: Select all
<html><a href="javascript:globals.myMethod()">ClickMe</a></html>

...to trigger methods from within HTML areas but these no longer seem to work. What is the best replacement for this code in 8?
David Rookwood

SAN Developer
drookwood
 
Posts: 259
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK

Re: Best replacement for <a href="javascript...." in HTML ar

Postby ROCLASI » Wed Jul 04, 2018 12:17 pm

Hi David,

By default Servoy doesn't trust HTML like that anymore. You can make it trust that specific element by adding the following code to your onLoad event:

Code: Select all
elements.NameOfElement.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true);


Hope this helps.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5276
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Best replacement for <a href="javascript...." in HTML ar

Postby drookwood » Wed Jul 04, 2018 2:18 pm

Hi Robert,

That's perfect - seems to work fine! Many thanks

Dave
David Rookwood

SAN Developer
drookwood
 
Posts: 259
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK


Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests