/    Sign up×
Community /Pin to ProfileBookmark

?

i need some help for my calculatioins part..
i have some troubles wit function
here is wat i have done
<html>
<head>
<title> Machining Time For Turning </title>
</head>

<body bgcolor=”aqua”>
<Script language=”javascript”>

function machiningTime(number) {
with (document.number) {

machiningtime=length/cuttingspeed*feedrate;

}
}

</Script>

<Form Name=”number” Method=”post” enctype=”text/plain”>

<table border=”0″ bgcolor=”mediumslateblue” width=”100%”>
<tr>
<td width=”100%” align=”right” colspan=”2″ height=”45″>
<p align=”center”>
<font size=”5″ color=”White”> Machining Time for Turning </font> </td>
</tr>
<tr>
<td width=”35%” align=”right” height=”45″><b> Length:</b> </td>
<td width=”65%”><input type=”text” name=”length” size=”25″></td>
</tr>
<tr>

<td width=”35%” align=”right” height=”45″><b> Cutting Speed:</b> </td>
<td width=”65%”><input type=”text” name=”cuttingspeed” size=”25″> </td>

</tr>
<tr>
<td width=”35%” align=”right” height=”45″><b> Feed Rate:</b> </td>
<td width=”65%”><input type=”text” name=”feedrate” size=”5″> </d>
</tr>
<tr>
<td width=”35%” align=”right” heigt=”45″><b> Machining Time:</b> </td>
<td width=”65%”><input type=”text” name=”time” size=”10″></td>
</tr>
<tr>
<td width=”35%”>
<p align=”center”><input type=”button” value=”maching time” oncClick=”Calculate(number)”></p>
</td>
<td width=”65%”><input type=”reset” value=”Reset” name=”reset”></td>

</table>

</body>
</html>

it’s suppose to calculate the machining time.
Machining time=Length/cuttingspeed*feedrate

Need help badly..
?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 07.2003 — You have several syntax errors and there is no function called Calculate().&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Machining Time For Turning &lt;/title&gt;
&lt;script language="javascript"&gt;
function calculate() {
with (document.num) {
time.value = len.value / cuttingspeed.value * feedrate.value;
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body bgcolor="aqua"&gt;
&lt;form Name="num" Method="post" enctype="text/plain"&gt;
&lt;table border="0" bgcolor="mediumslateblue" width="100%"&gt;
&lt;tr&gt;
&lt;td width="100%" align="right" colspan="2" height="45"&gt;&lt;p align="center"&gt;&lt;font size="5" color="White"&gt; Machining Time for Turning &lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="35%" align="right" height="45"&gt;&lt;b&gt; Length:&lt;/b&gt; &lt;/td&gt;
&lt;td width="65%"&gt;&lt;input type="text" name="len" size="25"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="35%" align="right" height="45"&gt;&lt;b&gt; Cutting Speed:&lt;/b&gt; &lt;/td&gt;
&lt;td width="65%"&gt;&lt;input type="text" name="cuttingspeed" size="25"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="35%" align="right" height="45"&gt;&lt;b&gt; Feed Rate:&lt;/b&gt; &lt;/td&gt;
&lt;td width="65%"&gt;&lt;input type="text" name="feedrate" size="5"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="35%" align="right" height="45"&gt;&lt;b&gt; Machining Time:&lt;/b&gt; &lt;/td&gt;
&lt;td width="65%"&gt;&lt;input type="text" name="time" size="10"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="35%"&gt;&lt;p align="center"&gt;&lt;input type="button" value="machining time" onclick="calculate()"&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td width="65%"&gt;&lt;input type="reset" value="Reset" name="reset"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@David_HarrisonApr 07.2003 — well i may only be a beginner but shouldn't there be a bit of script that says:

length = number.form.value

or some rearrangement of that.
×

Success!

Help @tintin_taurus 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.18,
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,
)...