Creating Clickable Link On Selected Text
Jul 14, 2009
Any way to select a portion of text and convert it to a clickable link? I have seen examples, where the selected text is wrapped in <a> tags, however, I have yet to see an example of having the link actually be clickable. The other issue appears to be with the document.selection property that Firefox seems to not support. So a cross-browser solution would be ideal. I intend to use this with a custom toolbar/button in FCKEditor. The toolbar is in place, we just need to resolve the selected text - clickable link issue.
View 1 Replies
ADVERTISEMENT
Sep 9, 2010
I have called a table through XML with four fields. One of them is Excel file name. I like to make a clickable link with Excel file name to open it.
XML code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<searchable_index>
<item name="Ana" title="Data" link="docana.xls">Member</item>
<item name="Ana" title="Data" link="docana.xls">Member</item>
[Code]....
View 1 Replies
View Related
Jun 13, 2010
I am working on a website that uses a random header. I have been trying to figure out how to adjust the code so that the header also serves as a clickable link.
Here is the code that I have:
What do I need to add in order for the header to also serve as a link? I am completely new to JavaScript and I don't understand it very well.
View 1 Replies
View Related
Oct 29, 2010
I have some Javascript that is selecting text from a form textarea and copying it to the clipboard:
document.myForm.myTextarea.focus();
document.myForm.myTextarea.select();
document.execCommand( 'Copy' );
This works great. However there is a problem when I try to paste the text somewhere else. Assuming that the text that is being copied is a [URL], I would like it to be pasted as a link. When I grab a URL from the address bar inside a web browser and paste it somewhere ( such as an e-mail ), it automatically shows up as a clickable link. When I put a URL into my form textarea and run the javascript, it gets pasted as a plain text ( ie. not underlined and not clickable ).
Why are these two different? I've tried running a program to see what is actually copied into the clipboard and I don't see any differences. There must be something that denotes the URL copied from the address bar as a link and therefore makes it clickable when pasted. Is there a way to force this in order to make what is copied to the clipboard from my form textarea a clickable link?
View 4 Replies
View Related
Mar 12, 2009
I am trying to make a clickable link in JS wheres as 2 variable assigned as Image URL and Link URL. I have changed the address per forum rules, but I assure you they are valid images addresses and link addresses
var _IMAGE_URL = "fakeaddress/picture.jpg";
var _LINK_URL = "fakeaddress";
var _BANNER = "<center><a href="" + _LINK_URL + ""><img src="" + _IMAGE_URL + ""></a></center>"
var _POST_THIS = _BANNER
This is then called upon later through _POST_THIS, into a text box, buts its not working. However if I change this:
var _BANNER = "TEST<SP>" + _LINK_URL + "<SP>TEST<SP>2<SP>" + _IMAGE_URL + "<SP>TEST<SP>3"
Everything posts fine, but ofcourse just as text addresses, such as
TEST fakeaddress TEST 2 fakeaddress/picture.jpg TEST 3
So my problem is in this line, trying to post as a clickable picutre,
var _BANNER = "<center><a href="" + _LINK_URL + ""><img src="" + _IMAGE_URL + ""></a></center>"
Kept hammering away, and the correct statement would be this
var _BANNER = "<center><a<SP>href="" + _LINK_URL + ""><img<SP>src="" + _IMAGE_URL + ""></a></center>"
View 2 Replies
View Related
Feb 22, 2007
... unless javascript is disabled.
Right now I have a set of links that I want to perform some javaScript when clicked on without actually navigating to the link.
I am using this code in the onClick attribute for the link
onClick="load(this); return false;"
and it works in IE and FF but in Opera it still follows the link.
Is there a better way to do this?
View 5 Replies
View Related
Apr 12, 2005
This is irritating cause i read a arcticle with a solution to this in one of the many newsletters i receive, but then i didn't need it and now i do i can't find it, and i'm searching for days now .
I have say 3 links
link1 --- link2 --- link3
all of then formatted nicelly with CSS. When i select one of then, say link1, it becames with a diferent background color.
What i want is to keep tha backg color even when the user clicks anywhere on the page (thus loosing focus) and until another link is clicked.
I tought this could be possible in a CSS only way, but now i think i have to use some Javascript.
View 2 Replies
View Related
May 19, 2010
like for example i have text areas named upload1 and upload2when I click or add input on upload1 a drop down list below upload2 will not change, but when I add input on upload2 the dropdown will select "parts"
View 3 Replies
View Related
Oct 7, 2009
Is there away to gather the values of all selected items in multiple select fields? Eg. I have three select lists.
Code:
<select name="tags1" id="tags1" value="tags1">
<option value="Male">Male</option>
<option value="Female">Female</option>
[code]....
I want to be able to get the results of what the user has selected in all three drop downs and place it into a single text field eg. if a user selects Male then Dog then Australia. The text field updates either on change or on submit to what the user has selected.
View 3 Replies
View Related
Oct 17, 2011
I'm trying to find a code which would take the input value entered in a form field and on click direct you to a page which corresponds with what was entered.So for example:
Enter "5" in field.
Click Submit.
Page opens up (which in fact would be an html file on my server called... 5.html)( i would want to create 10 pages for values entered from 1-10... each value having a unique result when entered and clicked)how to put this all together, i've been searching everywhere.
View 2 Replies
View Related
Oct 29, 2009
So I am trying to set up a registration form that when the user clicks the "Add Another" link then a new text field for the additional person and email field is added to the page. I dont know how to repeat this process to get what I want.
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.1EN"
"http:www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head>
<title>Registration Form</title>
<meta http-equiv="content-type"
[Code]....
View 2 Replies
View Related
Dec 15, 2009
I would like to create a link when a user moves their mouse over a specific item of text (there will be several on a page), the text being delimited by <span class= ></span> and the text itself will form part of the link. eg
[Code]....
View 8 Replies
View Related
Nov 9, 2010
I would like to have a link that does two things. One would be to refresh the page and secondly go to a diferent section on the page that I have an anchor to.
View 3 Replies
View Related
Feb 3, 2011
I'm trying to create a webpage where users can click on a dynamically generated set of questions:
<?php do { ?>
<p><?php echo $row_rsQuestions['question_text']; ?><?php echo $row_rsQuestions['question_type']; ?></p>
<?php } while ($row_rsQuestions = mysql_fetch_assoc($rsQuestions)); ?>
and by clicking on a particular question, there will be an update for their particular listing of personal questions in a MySql database. I know how to create the database update part, but I think that I would need to javascript to:
1) tell my page that it's time to update (i.e. add a particular question as soon as they click it)
2) pass along the correct variable to the database update portion of the page.
View 2 Replies
View Related
Apr 12, 2011
I'm using a form data reference, something like P-1234 for example to create a text file and a link to the file. This is during the construction of a new table or table row with javascript. I have an array of one or more references submitted via form using $_POST. On my action page I am creating a txt file P-1234. If I am creating a table ot table row using createElement(), one of the cells will have a link to the file. If the file is created as follows:
$File = $_POST['ref'][$i] . "txt";
After creating the cell
var Cell = document.createElement('td');
[code]....
I assume the link is inserted using innerHTML? If so, do I just append the filename to the end of the file path like this?
Cell.innerHTML = "http://localhost/Project/+File";
View 1 Replies
View Related
Sep 16, 2010
I want to have a link that when clicked on will call a specific php code. So when you click on the LSS link it sets a value to lss that I can call later with the php. This is what I have:
[Code]...
View 6 Replies
View Related
Oct 24, 2005
I have an XML document which lists some information about movies(Title, actor, etc.) I am using Javascript to pull that data and display it as html. Is it possible to create a link for each one of those titles that are pulled from the XML in my JS? Here is my code:
for (var i=0; movies.length > i; i++)
{
var Title = movies[i].getElementsByTagName("title");
var Actor = movies[i].getElementsByTagName("actor");
var Price = movies[i].getElementsByTagName("price");
results += i+1 + '. ' + ' "<span class="title"><a href="http://www.imdb.com">' + Title[0].firstChild.nodeValue + '</a></span>"' +
' starring <span class="actor">' + Actor[0].firstChild.nodeValue + '</span>' + ' and costs approximately $'+ Price[0].firstChild.nodeValue + "<br/>
";
}
document.getElementById("displayresults").innerHTML = results;
View 5 Replies
View Related
Aug 16, 2011
I'd like to use $.post to create php session variables on the fly when a link is clicked, and then let the browser follow the href content.
[Code]...
View 4 Replies
View Related
Oct 5, 2010
Anyone know how I can change the color of a text link on a page that doesn't load a new page, but rather stays on the same page?The nav links already use an onClick to present content below it that changes depending on what link in the nav I select. In other words, there's already two things going on -- links take you to content on the same page using a JS onClick.What I want to add to that is when you click on the link, it changes style, like turns bold or changes color. So then the user knows that not only have they selected new content, but the link they selected stands out as well.
View 1 Replies
View Related
Nov 23, 2011
I've searched high and low for some decent code that will allow a visitor to a website to bookmark the site through a hyperlink. The bookmarking is done through a javascript function that looks like this:
Code:
function OnBookmarkButtonClick (e)
{
if (window.sidebar)
[code]....
I need to add some detection for Opera, Safari, and Chrome. note that it must be feature detection, not browser detection. But as I said, I've searched high and low for this, and couldn't find anything.
View 3 Replies
View Related
Jun 17, 2010
I want to get the cursor start and end position of a selected range in a text-field or text-area. i tried lot of functions in various forums. but when the last character of the selection is a new line character JavaScript ignore it in IE6. any one having idea ?
View 1 Replies
View Related
Mar 3, 2010
Recently in my IT class, we made a HTML page which would open a popup box, where the user could enter a key word. When the user pressed enter, the page would navigate to a specific page. The code we used was:
<script language = "JavaScript">
where = window.prompt ("Please tell me where you would like to go.");
switch (where){[code].....
implement this code on my workplaces server, and have the keywords link to other html documents within the server. However when I tested this, for some reason the links are not working.
View 1 Replies
View Related
Jun 21, 2011
I would like to include drop-down navigation links on my home page that connect to other pages on my website. No problem there. The problem is that some of the other pages contain a series of div elements that are hidden (display:none) until activated by javascript enabled links on the page. Clicking those links changes some of the page's content (within a div) .. almost like a "new" page. [URL]. Here's my question: Is there any way to create menu links on my home page that will open the "concert.html" page AND display the appropriate div content at the same time?
For example: on the home page, a menu link under "Concert" that opens that page and automatically displays the "Rock Symphonies" section?
Here are the related HTML div elements on the "concert.html" page:
<div id="page1">concept content</div>
<div id="page2" style="display:none;">rock symphonies content</div>
<div id="page3" style="display:none;">general program content</div>
<div id="page4" style="display:none;">ticket price content</div>
<div id="page5" style="display:none;">concert committee content</div>
Here are the corresponding js-enabled links:
<li><a href="javascript:page(1,5);" id="tag1">Concept</a></li>
<li><a href="javascript:page(2,5);" id="tag2">Rock Symphonies</a></li>
<li><a href="javascript:page(3,5);" id="tag3">General Program</a></li>
<li><a href="javascript:page(4,5);" id="tag4">Ticket Prices</a></li>
<li><a href="javascript:page(5,5);" id="tag5">Concert Committee</a></li>
And here's the javascript I'm using: (scripts/generator.js)
function page(id,all) {for (i=1; i<=all; i++) { if (i==id) {
document.getElementById('page'+i).style.display="inline";
document.getElementById('tag'+i).style.fontWeight="normal";
document.getElementById('tag'+i).style.color="#FFF"; }
else {
document.getElementById('page'+i).style.display="none";
document.getElementById('tag'+i).style.fontWeight="normal";
document.getElementById('tag'+i).style.color="#a4bfed";} }}
View 2 Replies
View Related
Nov 4, 2011
I wanted to show text box when check box is selected , it doesnt work...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="jquery.js"></script>
[Code]...
View 3 Replies
View Related
Jun 16, 2006
I'm trying to 'wrap tags' around text in a text box.
<script language=javascript>
function insertFauxTags(fauxTag, e, endFauxTag)
{
var e = document.frmAddNewForum.txtTopicMessage.selected;
document.frmAddNewForum.txtTopicMessage.Value += fauxTag + e + endFauxTag;
}
</script>
And my form:
<form runat="server" id="frmAddNewForum">
<asp:textbox id="txtTopicMessage" runat="server" cssclass="formtext" rows="5" textmode="MultiLine" width="95%" style="width:95%"></asp:textbox>
</form>
And here's how I'm calling the function:
<a href="javascript:insertFauxTags('[p]' + e + '[/p]')"><img src="http://www.<%=strSiteName%>/images/parabutton.gif" border="0" alt="Paragraph" /></a>
When I run this in FF I get 'e' is not defined - any ideas?
View 1 Replies
View Related
Mar 13, 2011
I'm building a calendar and using a jQuery script to shift between "list view" and "calendar view". The thing is, that I would like to add a unique CSS class to the selected link, so I can make a highlight effect (or something like that) that only applies to the currently selected link. My script is:
jQuery(document).ready(function(){
//if this is not the first tab, hide it
jQuery(".tab:not(:first)").hide();
//to fix u know who
[Code]....
View 1 Replies
View Related