# Is it possible to trigger a popup using BBcode?

**URL:** <https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197>\
**Category:** Questions\
**Created:** [January 8, 2019, 6:00am UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197 "2019-01-08T06:00:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpmc123](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tpmc123](https://forum.bubble.io/u/tpmc123)\
**Post date:** [January 8, 2019, 6:00am UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/1 "2019-01-08T06:00:50Z")

</div>

Hi, I’d like to trigger a login/signup popup within a sentence. Is it possible using BBcode or some other method?

[Here](http://forum.bubble.io/t/solved-creating-link-to-launch-a-popup-within-a-sentence/3117) is the same question from 2016 … I’m hoping a cleaner method is available.

Thanks!

---

<div class="post-metadata">

**Author:** ![dan1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dan1/32/23411_2.png) [@dan1](https://forum.bubble.io/u/dan1)\
**Post date:** [January 9, 2019, 8:42pm UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/2 "2019-01-09T20:42:32Z")

</div>

It isn’t necessary to use BBCode for this. Rather, you can have Bubble “listen” for a specific word to be typed. And, when that happens, for a certain workflow to run

This GIF will take you through the basic process of setting that up.

![Jan%209%202019%2012_46%20PM](https://us1.discourse-cdn.com/bubble/original/3X/4/8/48ef9ebed3c65ea2f3817e21bb4fa32927187404.gif)

* * *

Dan (creator of [LearnTo](https://learnto.app?source=forum) - 15+ hours of Bubble tutorials and [live coaching](https://www.usesixty.com/users/841-dan-smolkin?m=true&r=841))

---

<div class="post-metadata">

**Author:** ![tpmc123](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tpmc123](https://forum.bubble.io/u/tpmc123)\
**Post date:** [January 13, 2019, 11:28pm UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/3 "2019-01-13T23:28:12Z")

</div>

Hi Dan,

Thanks for the response. I’m referring to a simple link in the middle of the sentence. For example, for a text element containing:

> You must log in or sign up to view.

I want “log in or sign up” to be a link to show a login/sign up popup.

Thanks!

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 13, 2019, 11:36pm UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/4 "2019-01-13T23:36:17Z")

</div>

Somewhere here in the forums I posted a solution to this. … ah here it is:

> [@Not So Stupid JavaScript Tricks: Span Class Fun](http://forum.bubble.io/t/not-so-stupid-javascript-tricks-span-class-fun/38031):
>
> Another quite informative video: @d.norkus asked a fascinating question about handling link-like behavior in a text element today. “Could different parts of a humble text element trigger different workflow actions?” Turns out they could: [https://vimeo.com/289964041](https://vimeo.com/289964041) For context, see original thread here:

---

<div class="post-metadata">

**Author:** ![tpmc123](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tpmc123](https://forum.bubble.io/u/tpmc123)\
**Post date:** [January 16, 2019, 11:46pm UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/5 "2019-01-16T23:46:14Z")

</div>

Thanks Keith! That did the trick.

For future readers:

- I installed the free Toolbox plugin
- added a “JavaScript to Bubble” element to page
- named the element’s suffix ‘loginPopup’, so my function name became bubble\_fn\_loginPopup.
- just below that, checked “Trigger event”
- added a workflow event (Elements \> A JavaScript to Bubble Event), choosing my new JavaScript function, that popped up my login popup

Here’s the content of my HTML element:

`<p style="color:#666666">Have an account? Please <span style="cursor:pointer;color:#1FACD5" onclick="bubble_fn_loginPopup()">log in</span>. Otherwise, fill in your name and email below.</p>`

Taking this further, in order to get the link to change color when hovered over and clicked, it doesn’t seem possible to do this using inline styling. Maybe I’d need to point the page to a stylesheet in the page’s header section?

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 17, 2019, 2:12am UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/6 "2019-01-17T02:12:15Z")

</div>

I believe you’ll have to give your span a name and then add some CSS to the page that notes what the :hover state should be for that span.

(Sorry, I am not hugely great with CSS. However, Googling about on styling spans on hover will get you there.)

---

<div class="post-metadata">

**Author:** ![tpmc123](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tpmc123](https://forum.bubble.io/u/tpmc123)\
**Post date:** [January 17, 2019, 4:06am UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/7 "2019-01-17T04:06:22Z")

</div>

yep, got it to work defining the span as a class, taking the CSS out of the span tags, then adding style tags to the pages header.

Here’s my new span code:  
`<p style="color:#666666">Have an account? Please <span class="login_text" onclick="bubble_fn_loginPopup()">log in</span>. Otherwise, fill in your name and email below.</p>`

I put this in the header b/w style tags:

```
    .login_text {
    cursor:pointer;
    color: #1FACD5;
    }

    .login_text:hover {
    color:#105A70;
    }

```

And it works. For some reason, I couldn’t get it to work by naming the span (using id=“some\_name”).

Ultimately, probably best to upload a .css file to the root directory so the styles are site-wide.

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 17, 2019, 5:50am UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/8 "2019-01-17T05:50:44Z")

</div>

I think the general reason for this (again, I suck at CSS) is that spans are generic containers. They do not have an id, but can be used to hold a class. (In fact, when I had this original idea as to how to solve the problem I was like, “spanclasses… yeah, spanclasses could do this”. Which is, of course, just me going “I’ve seen spanclasses before – I wonder what the heck those are.”… which is just my brain going “span… class… ah yes, a spanclass!”

But that’s the sort of explanation here.

You’re correct to make the CSS override/overload sitewide, so that you could just do this wherever you like and not have to worry about defining the hover state.

---

<div class="post-metadata">

**Author:** ![bigboyz](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/bigboyz/32/127294_2.png) [@bigboyz](https://forum.bubble.io/u/bigboyz)\
**Post date:** [May 22, 2022, 12:08am UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/9 "2022-05-22T00:08:00Z")

</div>

This post/reply is an oldie (3yrs) … but a goldie … so I wanted to say thank you Keith for your video 3yrs ago …

![image](https://us1.discourse-cdn.com/bubble/original/3X/9/c/9c796f08d9ac0942e4296a8462f25af62c47113b.png)

I wanted to kick a popup when the user clicks “see disclaimer” without converting the whole text element into a clickable element/event while preserving text/link/colour/click behaviour.

Rendering the text as an html element, then using the JS Toolbox (following Keith’s instructional video) hit the spot!

THANK YOU!

---

<div class="post-metadata">

**Author:** ![fernando2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fernando2/32/145204_2.png) [@fernando2](https://forum.bubble.io/u/fernando2)\
**Post date:** [September 21, 2022, 8:19pm UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/10 "2022-09-21T20:19:23Z")

</div>

Unfortounately this no longer seems to work… 😔

---

<div class="post-metadata">

**Author:** ![fernando2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fernando2/32/145204_2.png) [@fernando2](https://forum.bubble.io/u/fernando2)\
**Post date:** [September 22, 2022, 2:46pm UTC](https://forum.bubble.io/t/is-it-possible-to-trigger-a-popup-using-bbcode/46197/11 "2022-09-22T14:46:09Z")

</div>

Solution is [here](http://forum.bubble.io/t/click-events-within-text-fields-a-challenge/225429).
