How to add Multiple URL's in URL type field? Is it possible to take more than one URL in URL type field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2014 01:53 PM
Hu All,
I'm working in Eureka. I've a URL type field on incident form. But, that URL type field takes one URL only. But, I need to add two URL's in the URL type field and it should display as one by one.
For Example, I've two URLs:
1- https://www.gmail.com, 2- https://www.google.co.in
When I take the field type as URL and the above two values are displayed as:
https://www.gmail.com/ https://google.co.in
But I need to displayed as
Please let me know, how to add multiple URL's in URL field type.
Regards,
Prasanna Kumar Duvvuri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2014 12:32 AM
If you want to add only two URLs then create 2 seperate fields (Type as URL) on the incident form and if it is greater than 2 then better to create separate table and add as related list on the incident form, because there is no way to make it work as glide_list.
Thanks
Chanchal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 07:34 AM
As I posted on another topic:
By DOM manipulation, onLoad script (the code is a bit shoddy but works for me):
-------------------------------------------------------------------------------------------------------------------
var originalOuterHtml;
var counter = 0;
var links;
var originalId;
function onLoad() {
var varname = 'u_testing'; // This is the only thing you need to change - field name
var el = g_form.getElement(varname);
originalOuterHtml = el.outerHTML;
originalId = el.id;
links = g_form.getValue(varname).split("\n")
changeLabelClickEvent(varname);
}
function changeLabelClickEvent(varname){
var label = g_form.getLabel(varname);
var pattern = /onclick="(.*);"/;
var found = pattern.exec(label.outerHTML);
if(found[0]){
var newOnclick = "onclick=\"return changeElementType('"+varname+"');\"";
label.outerHTML = label.outerHTML.replace(found[0],newOnclick);
}
}
function changeElementType(varname){
var pair = counter % 2;
var el = document.getElementById(originalId);
counter++;
if(pair == 0){
var newOuterHtml = "<div id='"+originalId+"'>";
for(var i=0; i<links.length; i++){
newOuterHtml += '<a href="'+links[i]+'">'+links[i]+'</a><br>';
}
newOuterHtml += "</div>";
el.outerHTML = newOuterHtml;
}else{
el.outerHTML = originalOuterHtml;
changeLabelClickEvent(varname);
}
}
-------------------------------------------------------------------------------------------------------------------
How it works? you have a textarea field called 'u_testing' (in my example) and there you write your urls. By clicking on the field label the field will change into the urls you wrote on the textArea. By click label again it will change back to the original textArea field allowing you to modify the urls.
Regards,