• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

web app text hyperlink field, make links, can it open in a new window?

Community Beginner ,
Apr 15, 2012 Apr 15, 2012

Copy link to clipboard

Copied

HI, i've created a web app that contains a website url in a field type that is text(hyperlink), this automatically creates a link when i pull that field into a page,

Is there a way to make these links open in a new window or target?

My only thought is I have to change the field type to plain text(string), and then cretae a urlwith target, and pullthe value into that code?

If so, if I already ahve existing web app items, is the data safe when you switch a field's type?

TOPICS
Web apps

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 15, 2012 Apr 15, 2012

Copy link to clipboard

Copied

I found an external script to make sure off-site links open in a new window.

http://www.dynamicdrive.com/dynamicindex8/newwindow2.htm

Turns out trying to change a web app field's field type after its created is not allowed. so with 2500 web app items, i really don;t want to erase that field and reinsert a new field for holding a website link, B/c if i set to text(string) so that it returns the value in plain text, and i can populate a static hyperlink on a page.

Hopefully BC will address this internally, maybe we could simply add a extra modifier like "_blank" to any text(hyperlink) field?

{tag_fieldname} to {tag_fieldname_blank}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 15, 2012 Apr 15, 2012

Copy link to clipboard

Copied

Hi Richard,

You are correct. Once the database field has been created its type can not be changed. You would need to export the items, delete the field and recreate it as a Text(String) field type, then wrap its tag inside the href and add target="_blank" to it. Then you'd have to re-import the web app items.

Since it is a lot of work you may as well use some simple JavaScript to add that target attribute to your links.

As for {tag_fieldname_blank} I think thats a great suggestion and I'll add it as a feature request to our ticketting system.

Cheers,

Mario

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 15, 2012 Apr 15, 2012

Copy link to clipboard

Copied

That would be a great addition, unrelated but whats the easiest way to loginto the new forums to reply, I had to loginat the very top right, but then go back to my email to cliock this link to get me back to the thread as logged in, seems a lot to just post a reply

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 15, 2012 Apr 15, 2012

Copy link to clipboard

Copied

Not sure why that is, Rich... This forum keeps me logged in all the time. I haven't had to log in since I started using it. I'm on Mac in latest Chrome.

Cheers,

-mario

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2012 Apr 15, 2012

Copy link to clipboard

Copied

Make sure you remember when you logged in. Ipad, Mac and PC different browsers it keeps me logged in.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 19, 2012 Dec 19, 2012

Copy link to clipboard

Copied

LATEST

You can try this:


//using jquery:
$
(document).ready(function(){
  $
('#link_other a').attr('target', '_blank');
});

// not using jquery
window
.onload = function(){
 
var anchors = document.getElementById('link_other').getElementsByTagName('a');
 
for (var i=0; i<anchors.length; i++){
    anchors
[i].setAttribute('target', '_blank');
 
}
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines