1- I’ve given the input field an HTML ID.
2- I’ve setup a basic workflow for the button which includes a basic script to open upon Google is a new tab which works so far.
window.open(‘
Google
’ + ‘
term
’);
2- The issue I’m having or trying to figure out is the function, listener or syntax that would work in Bubble to first give the term a name and value so that I can use the document.getElementByID(‘xxxx’) and then execute my basic script above. Nothing complicated I think but I’m but thought I’d turn to the experts since this is way beyond my capabilities…I have an elementary understanding of HTML, JQuery, Javascript etc… I’m looking for an easy win here…Thanks a bunch!.
@Bubble_clic
Why do you need to use JavaScript for this?
You can just use basic Bubble functionality to access the input’s value… i.e.
windo.open(‘Google’ + ‘
Input's value
’);
In fact, why do you need to use JavaScript at all here?
Can’t you just use a standard Open External Website Bubble action?
Is there a specific reason for not using vanilla Bubble for this?
Try this, no document.getElementByID(‘xxxx’) required, just pure Javascript (Toolbox plugin)
If you use
window.open(url, '_blank')
, it will be blocked (popup blocker) on Chrome.
Hmm like [adamhholmes] said you can do this with native bubble action, i didnt even noticed that lol
just create a button action Open External Website, and the url should be like h ttps://www.google.com/search?q=[YOUR INPUT VALUE]
if you are having trouble opening in a new tab, i suggest you to search for a plugin called ‘Open url tab’ that should do the trick