Hello
I was wondering if someone could help me with hyperlinking an array value. What i am currently doing in
asp and javascript is retrieving data from an excel spreadsheet based on a drop down list. It works correctly but i want to hyperlink the values that get returned from the drop down list.
My code looks like this
Code:
<script language="javascript">
function getdetails() {
var cust = document.getElementById("customers").value;
<%if strAddDetails = 2 then%>
var custnames = new Array(5);
<%for c = 0 to ct%>
custnames[<%=c%>] = new Array(5);
custnames[<%=c%>][0] = "<%=CustomerArray(0, c)%>";
custnames[<%=c%>][1] = "<%=CustomerArray(1, c)%>";
custnames[<%=c%>][2] = "<%=CustomerArray(2, c)%>";
custnames[<%=c%>][3] = "<%=CustomerArray(3, c)%>";
custnames[<%=c%>][4] = "<%=CustomerArray(4, c)%>";
custnames[<%=c%>][5] = "<%=CustomerArray(5, c)%>";
<%next%>
<%end if%>
var spancust = "";
if (document.getElementById("customers").selectedIndex > 0) {
var sc;
<%if strAddDetails = 2 then%>
for (var b =0;b<=<%=ct%>;b++) {
sc = custnames[b][0];
if (sc == cust) {
if (custnames[b][1] != '') {
spancust += ("<b>SheetForm1: </b> " + custnames[b][1] + "<br />");}
if (custnames[b][2] != '') {
spancust += ("<b>SheetForm2: </b> " + custnames[b][2] + "<br />");}
if (custnames[b][3] != '') {
spancust += ("<b>SheetForm3: </b> " + custnames[b][3] + "<br />");}
if (custnames[b][4] != '') {
spancust += ("<b>SheetForm4: </b> " + custnames[b][4] + "<br />");}
if (custnames[b][5] != '') {
spancust += ("<b>SheetForm5: </b> " + custnames[b][5] + "<br />");}
}
}
<%end if%>
}
document.getElementById("customerspan").innerHTML = spancust;
}
</script>
At the moment when a drop down is clicked a value is found in an excel spreadsheet.
What i want is to have a hyperlink here on my output to hyperlink to a dcoument based on the value returned for custnames[b][1]
I have a variable called strPath which remains contant.
I have tried the following but no luck
Code:
strPath = "file://myserver/customer documents/
if (custnames[b][1] != '') {
spancust += ("<b>SheetForm1: </b> " + custnames[b][1] + "href=<%strPath%> + custnames[b][1]" + "<br />");}