Click events within text fields, a challenge

Hi all,

There’s something I can’t figure out how to do and would love to get some insight if possible.

So within a given text I am trying to fire click events whenever the user clicks on individual words (say a user clicks on a hashtag). This has been covered in the past in other topics, but it doesn’t apply to this situation. Let me explain why…

Now I understand text fields use BBCode and those do allow URL tags for linking, however the problem with that is that it will always force a page reload which resets the entire page and all its states, something that really is not appropriate for a single page application.

So the way I was approaching this was by using a Javascript to Bubble element from the Toolbox plugin and trying to fire an onclick event whenever the user clicked on a specific word to trigger an action in my workflow.

While researching the forum and google I’ve seen some people mentioning that this is indeed possible within BBCode by using the <span>or [html] tags. However it does seem that both tags are disabled on Bubble (can anybody confirm?).

So now I’m back trying to figure if there is some other way to achieve this… anybody up for the challenge? :wink:

Hey what do you know, I just figured it out!! lol

Here is the solution so others can also use this:

Install the toolbox plugin and add a Javascript to Bubble element to your page.

Then basically this is how you construct the URL link within your text to call you a workflow action:

[url="javascript:bubble_fn_myfunction('optionalvalue');" target="_self"] your text [/url]

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.