/    Sign up×
Community /Pin to ProfileBookmark

clone.getElementsByTagName("td"[6]has no properties !!

hello,

I always received a message “clone.getElementsByTagName(“td”)[6] has no properties message !!! how to I avoid this problem ?

Also, I would like to have 1 more row added in “Clock Information section” AND 1 more row added in “Clock’s False Path Information” when the button “insert another clock” is pushed…

Can you please help… ?
Thank you very much in advance

The below is my code:
————————————–

<html>

<head>
<title> RC/DC Synthesis Constraint generator Page</title>

<script type=”text/javascript”>

var clone;
function cloneDiv_c(){
var divs=document.getElementById(‘clkDiv’).getElementsByTagName(‘div’);
clone=divs[divs.length-1].cloneNode(true);
}

function cloneDiv_fp(){
var divs=document.getElementById(‘fpDiv’).getElementsByTagName(‘div’);
clone=divs[divs.length-1].cloneNode(true);
}

function removeDiv_c(){
var root=document.getElementById(‘clkDiv’);
var divs=root.getElementsByTagName(‘div’);
root.removeChild(divs[divs.length-1]);
}

function removeDiv_fp(){
var root=document.getElementById(‘clkDiv’);
var divs=root.getElementsByTagName(‘div’);
root.removeChild(divs[divs.length-1]);
}

function addDiv_c(){
var root=document.getElementById(‘clkDiv’);
var divs=root.getElementsByTagName(‘div’);
var nr=root.getElementsByTagName(‘table’).length+1;
clone.getElementsByTagName(‘td’)[6].firstChild.nodeValue=nr;
root.appendChild(clone);
clone=divs[divs.length-1].cloneNode(true);
}

function addDiv_fp(){
var root=document.getElementById(‘fpDiv’);
var divs=root.getElementsByTagName(‘div’);
var nr=root.getElementsByTagName(‘table’).length+1;
clone.getElementsByTagName(‘td’)[3].firstChild.nodeValue=nr;
root.appendChild(clone);
clone=divs[divs.length-1].cloneNode(true);
}

function addDiv_clock(){
addDiv_c();
addDiv_fp();
}

function removeDiv_clock(){
removeDiv_c();
removeDiv_fp();
}

function cloneDiv_all () {
cloneDiv_c ();
cloneDiv_fp ();
}

onload= cloneDiv_all;

</script>
</head>

<body>

<H1> <center> RC/DC Synthesis Constraint Generator </center> </H1>
<P>

<DL>
<b> <font size = “4” > Clock Information </font> </b>
</DL>
<FORM id=”form_clock” action=”” method=”post” >
<div id=”clkDiv”>

<div>
<table border=”1″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”left”>Clock Name &nbsp <input type=text name=clk value=”pll_clk” size=15></td>
<td><p align=”left”>&nbsp Clock Pin/Port Name &nbsp <input type=text name=pin value=”pll_top_u/PLLOUT” size=”29″></td>
<td><p align=”left”>&nbsp Clock Period &nbsp <input type=text name=period value=”25″ size=”5″></td>
<td><p align=”left”>&nbsp Rise &nbsp <input type=”text” name=”rise” value=”0″ size=”5″></td>
<td><p align=”left”>&nbsp Fall &nbsp <input type=”text” name=”fall” value=”0″ size=”5″> </td>
<td><p align=”left”>&nbsp Generated clock &nbsp <select name=”selected”>
<option value=”no” selected=”selected”>no</option>
<option value=”yes” >yes</option>
</select> </td>
</tr>
</table>
</div>

<div>
<table border=”1″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”left”>Clock Name &nbsp <input type=text name=clk value=”scan_clk” size=15></td>
<td><p align=”left”>&nbsp Clock Pin/Port Name &nbsp <input type=text name=pin value=”phy_clksie_i” size=”29″></td>
<td><p align=”left”>&nbsp Clock Period &nbsp <input type=text name=period value=”1000″ size=”5″></td>
<td><p align=”left”>&nbsp Rise &nbsp <input type=”text” name=”rise” value=”0″ size=”5″></td>
<td><p align=”left”>&nbsp Fall &nbsp <input type=”text” name=”fall” value=”50″ size=”5″> </td>
<td><p align=”left”>&nbsp Generated clock &nbsp <select name=”selected”>
<option value=”no” selected=”selected”>no</option>
<option value=”yes” >yes</option>
</select> </td>
</tr>
</table>
</div>

<div>
<table border=”1″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”left”>Clock Name &nbsp <input type=text name=clk size=15></td>
<td><p align=”left”>&nbsp Clock Pin/Port Name &nbsp <input type=text name=pin size=”29″></td>
<td><p align=”left”>&nbsp Clock Period &nbsp <input type=text name=period size=”5″></td>
<td><p align=”left”>&nbsp Rise &nbsp <input type=”text” name=”rise” size=”5″></td>
<td><p align=”left”>&nbsp Fall &nbsp <input type=”text” name=”fall” size=”5″> </td>
<td><p align=”left”>&nbsp Generated clock &nbsp <select name=”selected”>
<option value=”no” selected=”selected”>no</option>
<option value=”yes” >yes</option>
</select> </td>
</tr>
</table>
</div>

</div>

<p align=”left”><input name=”button” type=”button” value=”Insert another clock” onclick=”addDiv_clock()”>
<input name=”button” type=”button” value=”Remove last clock entry” onclick=”removeDiv_clock()”>

<DL>
<b> <font size = “4” > Clock’s False Path Information </font> </b>
</DL>

<div id=”fpDiv”>

<div>
<table border=”1″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”left”>set_false_path -from &nbsp <input type=”text” name=clk value=”pll_clk” size=”15″> </td>
<td><p align=”left”>&nbsp -to &nbsp <input type=”text” name=clk value=”scan_clk” size=”15″> </td>
<td><p align=”left”>&nbsp &nbsp &nbsp &nbsp &nbsp Confirmation &nbsp <select name=”selected”>
<option value=”no” selected=”selected”>no</option>
<option value=”yes” >yes</option>
</select> </td>
</tr>
</table>
</div>

<div>
<table border=”1″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”left”>set_false_path -from &nbsp <input type=”text” name=clk value=”scan_clk” size=”15″> </td>
<td><p align=”left”>&nbsp -to &nbsp <input type=”text” name=clk value=”pll_clk” size=”15″> </td>
<td><p align=”left”>&nbsp &nbsp &nbsp &nbsp &nbsp Confirmation &nbsp <select name=”selected”>
<option value=”no” selected=”selected”>no</option>
<option value=”yes” >yes</option>
</select> </td>
</tr>
</table>
</div>

</div>

</FORM>

</bod>

</html>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ZeroKilledOct 15.2008 — the function [B]cloneDiv_c[/B], as well [B]cloneDiv_fp[/B], are overwriting the variable [B]clone[/B]. so, when you call [B]addDiv_c[/B], the clone doesn't contain six cell (td), it actually contain the three cell from [B]clock's false path information[/B]. you need two different variable to retain each clone. also, you know there is six cell on each [B]clock information[/B] but [B]getElementsByTagName[/B] return an HTMLCollection that is similar to array. that is, the collection contain an index. so, the sixth index mean the cell number seven, which doesn't exist. same happen with third index you refer in [B]addDiv_fp[/B]. those are the reason why you are getting such error.
×

Success!

Help @goober35 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...