How to make a button that will open a URL in the browser

43 views
Skip to first unread message

Sylvie Dupont

unread,
Sep 8, 2015, 8:27:26 PM9/8/15
to ParaSQL
This works:
<a href='https://www.parasql.com' target='_blank'>Go</a>

But this does not work:
<a href='@value(MyTable.MyFieldURL)'='_blank'>Go</a>

When I click on it, it opens a new Window in my browser and give me a 404 Not Found on this server error.
Here's what it's always written in the address:

https://www.parasql.com/'whatever address is in the field'

Thank you.

ParaSQL Support

unread,
Sep 9, 2015, 10:29:45 AM9/9/15
to ParaSQL
Per the ParaSQL documentation, @value() returns a single quoted string if referencing a character field. 

Usage examples:

WRONG:
<a href='@value(MyTable.MyFieldURL)'  target='_blank'>Go</a>


CORRECT:
 <a href=@value(MyTable.MyFieldURL)  target='_blank'>Go</a>


The @value() is substituted with a string within single quotes, therefore it should not be quoted.

Sylvie Dupont

unread,
Sep 9, 2015, 11:54:06 AM9/9/15
to ParaSQL
Knew it was something really stupid! Thanks a lot! :-)

Sylvie Dupont

unread,
Sep 9, 2015, 8:30:37 PM9/9/15
to ParaSQL
And if I want it like the other buttons? (a basic one)

I've tried this (it does anything on click):

<div class='BasicButton' onclick="
var a = document.createElement('a');
a.href = @value(MyTable.MyFieldURL) target='_blank';
a.click();
">Go</div>

Thank you.

ParaSQL Support

unread,
Sep 10, 2015, 11:45:22 AM9/10/15
to ParaSQL
Try this:

<div class='BasicButton' onclick="
var a = document.createElement('a');

a
.href = @value(MyTable.MyFieldURL);
a
.target = '_blank';
a
.click();
">Go</div>


Reply all
Reply to author
Forward
0 new messages