I've searched high and low, and have not been able to find a solution for what I am trying to do.
I am adding dynamic rows, and doing it by element id, using code such as this:
var cellRight = row.insertCell(1);
var el = document.createElement('input');
el.type = '';
el.name = 'description' + iteration;
el.id = 'description' + iteration;
el.size = 55;
cellRight.appendChild(el);
I have one field where I would like to add a text link, and have it open a new sized window. A popup, basically. I have tried many different code snippets I have found, and none of them have done that. The closest I have come is a new tab in a full page.
var cellRight = row.insertCell(3);
var el = document.createElement("td");
var cell=document.createElement('td');
var link=document.createElement('a');
link.setAttribute('href','http://www.domain.com/page.php');
link.setAttribute('target','_blank');
link.setAttribute('height','400');
link.setAttribute('width','500');
link.appendChild(document.createTextNode('Page'));
cell.appendChild(link);
el.appendChild(cell);
cellRight.appendChild(el);
I have also tried things like:
link.onclick(window.open('http://www.domain.com/page.php','popUpWindow','height=400,width=500,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
and
el.html('<a href="JavaScript:newPopup(\'http://www.domain.com/page.php\');">Page</a>');
I can make it work in regular javascript with this code, but I use this in the first "row" of inputs, and the element id is being used to create the subsequent dynamic rows.
<script type="text/javascript">
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=400,width=500,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
<a href="JavaScript:newPopup('http://www.domain.com/page.php');">Page</a></td>
I hope there is either a link, or an example that someone can offer to help me make this work.
Thanks in advance for your help.