Hi.
I'd like to build an "a href" tag inside a table "td" tag programmatically. Basically something like the following:
<table>
<tr>
<td>
<a href="javascript:void(0);" onclick="vbscript:viewAttachment 123" title="View document">View document</a>
</td>
</tr>
</table>
When I run my code below, however, and click on the generated link, nothing happens. It's like the subroutine "viewAttachment" isn't being called at all. Am I doing something wrong. Thanks!
set objTBody = document.createElement("tbody")
set objTR = document.createElement("tr")
set objTD = document.createElement("td")
set objA = document.createElement("a")
set objAttribute = document.createAttribute("href")
objAttribute.nodeValue = "javascript:void(0);"
objA.setAttributeNode obJAttribute
set objAttribute = nothing
set objAttribute = document.createAttribute("onclick")
objAttribute.nodeValue = "vbscript:viewAttachment " & intDocID
objA.setAttributeNode obJAttribute
set objAttribute = nothing
set objAttribute = document.createAttribute("title")
objAttribute.nodeValue = "View document"
objA.setAttributeNode obJAttribute
set objAttribute = nothing
objA.appendChild document.createTextNode("View document")
objTD.appendChild objA
objTR.appendChild objTD
objTBody.appendChild objTR
I'd like to build an "a href" tag inside a table "td" tag programmatically. Basically something like the following:
<table>
<tr>
<td>
<a href="javascript:void(0);" onclick="vbscript:viewAttachment 123" title="View document">View document</a>
</td>
</tr>
</table>
When I run my code below, however, and click on the generated link, nothing happens. It's like the subroutine "viewAttachment" isn't being called at all. Am I doing something wrong. Thanks!
set objTBody = document.createElement("tbody")
set objTR = document.createElement("tr")
set objTD = document.createElement("td")
set objA = document.createElement("a")
set objAttribute = document.createAttribute("href")
objAttribute.nodeValue = "javascript:void(0);"
objA.setAttributeNode obJAttribute
set objAttribute = nothing
set objAttribute = document.createAttribute("onclick")
objAttribute.nodeValue = "vbscript:viewAttachment " & intDocID
objA.setAttributeNode obJAttribute
set objAttribute = nothing
set objAttribute = document.createAttribute("title")
objAttribute.nodeValue = "View document"
objA.setAttributeNode obJAttribute
set objAttribute = nothing
objA.appendChild document.createTextNode("View document")
objTD.appendChild objA
objTR.appendChild objTD
objTBody.appendChild objTR