Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link to file

Status
Not open for further replies.

Killborg

Technical User
Jul 16, 2007
46
US
Hello I have a page when you select a item from a drop down menu it will display the image to the selection made also it will display information about that product. What I cannot figure out is how to add a link to a pdf file in the information that is displayed. I want the link to the PDF file to be where it says "Select to View PDF. How do I add the link when I add ahref I get an error and no product information is displayed.

Thanks for any help

thetext2[3]="<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens Sizes<br><strong>View PDF: </strong>Select to view PDF</br>"

Entire page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Canadian Backers</title>
<link href="mm_Canada.css" rel="stylesheet" type="text/css" />
<script language="javascript"><!--
function showimage()
{
if (!document.images)
return
document.images.panta_pics.src=
document.CanadaGallery.CanPantas.options[document.CanadaGallery.CanPantas.selectedIndex].value
}
//--></script>
</head>

<body>
<form id="CanadaGallery" name="CanadaGallery" method="post" action="">
<div id="CanGallTable">
<div id="CanGallMainHeader"></div>
<div id="CanGallHeader">Shirt Patterns </div>
<div id="CanGallDisplay">
<div id="Can"> <img src="PantaImg/PantaBlank.png" name="panta_pics" width="580" height="275" border=0 id="panta_pics" />
<img src="BordImg/BorderBlank.png" name="border_pics" width="580" height="275" border=0 id="border_pics" /> </div>
</div>
<div id="CanGallWarn">Images are enlarged and PMS colors are simulated for viewing on the internet only.<br />
Be aware that colour can vary based on printing equipment, shirt color and a variety of other factors and therefore may not match this example exactly </div>
<div id="CanGallSubHeader"> Backer Information</div>
<div id="CanGallSelection">
<select name="CanPantas" size="1" id="CanGallDropdown" onchange="showimage();displaydesc(document.CanadaGallery.CanPantas, thetext2, 'textcontainer2');">
<option value="PantaImg/PantaBlank.png">Select a Panta</option>
<option value="PantaImg/LinenPB.png">Linen Process Blue</option>
<option value="PantaImg/LinenRB.png">Linen Reflex Blue</option>
<option value="PantaImg/BankerPC.png">Linen Cyan</option>
</select>
</div>
<div id="CanGallSelection"></div>
<div id="CanGallInfo">
<div id="CanGallInfoField"><span id="textcontainer2"></span></div>
</div>
</div>
<script type="text/javascript">
var thetext2=new Array()
thetext2[0]="<strong>No Panta Selected</strong>"
thetext2[1]="<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens, Women and Children Sizes<br><strong>View PDF: </strong>Select to view PDF</br>"
thetext2[2]="<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens, Women Sizes<br><strong>View PDF: </strong>Select to view PDF</br>"
thetext2[3]="<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens Sizes<br><strong>View PDF: </strong>Select to view PDF</br>"

function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}
</script>

</div>

<table border="0" cellspacing="0" cellpadding="0"><tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">&nbsp;</th>
</tr>
</table>
</form>
</body>
</html>
 
Hi

How are you adding the link ?

What error you get ?

And next time please post you code between [tt][ignore]
Code:
[/ignore][/tt] and [tt][ignore]
[/ignore][/tt] tags.

Feherke.
 
This is where I am inserting the link information.

thetext2[3]="<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens Sizes<br><strong>View PDF: </strong><a href="../../../../LinenShirt.pdf" target="_blank">Select to view PDF</a></br>"

Get the error in internet explorer
Line: 31
Char: 13
Error: 'thetext2' is undefined
Code: 0
URL: file:///file location


 
This is where I am inserting the link information.
<code>

thetext2[3]="<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens Sizes<br><strong>View PDF: </strong><a href="../../../../LinenShirt.pdf" target="_blank">Select to view PDF</a></br>"

</code>

Get the error in internet explorer
Line: 31
Char: 13
Error: 'thetext2' is undefined
Code: 0
URL: file:///file location
 
Hi

Let us see your string, I mean strings :
Killborg said:
thetext2[3]=[highlight pink]"<strong>Panto: </strong>Linen<br><strong>Color: </strong>Process Blue<br><strong>Feature(s): </strong>Heat Sensitive Ink<br><strong>Available Formats: </strong>Mens Sizes<br><strong>View PDF: </strong><a href="[/highlight]../../../../LinenShirt.pdf[highlight pink]" target="[/highlight]_blank[highlight pink]">Select to view PDF</a></br>"[/highlight]
So change the outer double quotes ( " ) to single quotes ( ' ), or escape the inner double quotes with backslash ( \ ).

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top