OK, maybe the titles not the best but here goes.
This is the current page.
HTML Code:
<html>
<!--
By [hidden]
April 2007
Licensed for use by [hidden].
email: [hidden]
-->
<head>
<title>TEKNEK Takt Timer by [hidden]</title>
<style type="text/css">
<!--
.style1 {
font-size:28px;
text-align:center;
font-family: Tahoma, Arial;
font-weight: bold;
}
.style2 {
font: Tahoma, Arial;
font-size:14px;
text-align:left
}
.style3 {
font: Tahoma, Arial;
font-size:36px;
}
-->
</style>
</head>
<script language="JavaScript">
<!-- Hide JavaScript from old browsers
function isValidForm(form){
//Check that none of the fields are empty
if(form.upy.value==""){
window.alert("You must enter the number of units produced per year.");
//form.upy.focus();
}
if(form.dpy.value==""){
window.alert("You must enter the number of days worked per year.");
form.upy.focus();
}
if(form.mpw.value==""){
window.alert("You must enter the number of minutes worked per week.");
form.upy.focus();
}
if(form.dpw.value==""){
window.alert("You must enter the number of days worked per week.");
form.upy.focus();
}
if(form.eff.value==""){
window.alert("You must enter the efficiency.");
form.eff.focus();
}
//Calculation for takt time
//Link to a new window displaying the Takt time
}
//End hiding-->
</script>
<noscript>
<p class="style3">This site requires JavaScript! Please turn this on, or contact your IT Department for assistance</p>
</noscript>
<body>
<p class="style1">Welcome to the TEKNEK Takt Timer</p>
<form onsubmit="isValidForm(this);">
<p class="style2">Please enter all data requested</p>
<br>
<p class="style2">Units produced per year <input type="text" name="upy" size="10">Units</p>
<p class="style2">Days worked per year <input name="dpy" type="text" size="10">Days</p>
<p class="style2">Minutes worked wer week <input name="mpw" type="text" size="10">Minutes</p>
<p class="style2">Days worked per week <input name="dpw" type="text" size="10">Days</p>
<p class="style2">Production efficiency <input name="eff" type="text" size="5">%</p>
<br>
<p class="style2"><input type="submit" value="Submit">
<input type="reset" value="Clear"></p>
</form>
</body>
</html>
Basically the idea is you input the required stuff and it outputs the Takt time. Dont worry about the calculation and stuff tho, its a japenese way of making projects efficient.
Anyways, what I was looking to do was that when you click "Submit", it checks the fields (if empty then screw you), and then it will calculate the takt time and hows the results in a new window. However, I am unsure as to whether I can open a new window and set its content from outside that window.
If however, the conclusion is Nope, you cant make a new window with custom content, then how can I get it to show the takt time etc on this window eg is there a
"[object].write([variable]);
command or something. Ideally I want to do this in JavaScript.
Thanks