/    Sign up×
Community /Pin to ProfileBookmark

where the function can be used ?

Hi,

Normally, the function can be called in
the <script> ….</script> section.

But can I call the function in the <td> section ?
would you please take a look at my code below:

<html>

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

<script type=”text/javascript”>

function getclocknames(x){
var root=document.getElementById(‘myDiv’);
var divx=root.getElementsByTagName(‘div’)[x];
var clkname=divx.getElementsByTagName(‘input’)[0].value;
return clkname;
}

</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=”myDiv”>

<div>
<table border=”1″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”left”>Clock Name &nbsp <input type=text name=clk value=”sysclk 2″ size=15></td>
<td><p align=”left”>Clock Name of the line above &nbsp <input type=text name=pin value=”[B][U]getclocknames(1)[/U][/B]” size=”29″></td>
<td><p align=”left”>Do you want this clock [B][U](getclocknames(1)) [/U][/B]to have a false path <select name=”selected”> <option value=”no” selected=”selected”>no</option> <option value=”yes” >yes</option> <option value=”yes” >yes</option>
</tr>
</table>
</div>
</FORM>
</bod>
</html>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorOct 13.2008 — It looks like you are a little bit confused about how does javascript work. Javascript works like that:

A document has elements, displayed in a DOM tree. Elements have attributes. Attributes have values. In order to create/change/remove elements/attributes/values, javascript uses methods. Methods are nested in functions. Functions are called by events, following a user's action.

Now, you must tell us which could be the user's action (he will click something? roll over something? loading something?) and the support element (What something? - the document? the window? a cell? a button? a link?)...
Copy linkTweet thisAlerts:
@goober35authorOct 13.2008 — Hi,

The user's action is clicking on Clock Name box and type the clock name.

Based on what the user type for example the user will type "abc_clk"

then the getclocknames function will obtain the "abc_clk" strings and

display "Do you want this clock abc_clk to have a false path yes/no ?"

my second <td> and third <td> are depend on the user typing inside the box.

or please view the attached picture below

[upl-file uuid=da08241a-8b74-42c4-980e-e722a71caabf size=31kB]capture_image2.jpg[/upl-file]
×

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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...