Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-24-2007, 08:12 AM
domestic's Avatar   
domestic domestic is offline
Learning Programmer
 
Join Date: Mar 2007
Location: SCOTLAND!
Age: 20
Posts: 39
Credits: 0
Rep Power: 6
domestic is on a distinguished road
Default New window with custom content - JS

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
__________________
.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS

Website:
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Opportunity is missed by most people because it is dressed in overalls and looks like work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-24-2007, 12:45 PM
Chan Chan is offline
Programming Professional
 
Join Date: Jun 2006
Posts: 204
Credits: 1
Rep Power: 10
Chan is on a distinguished road
Default

Ahh, that is easy. I had this in class. I'll paste the info.

HTML Code:
<html>
<head>
<title>"Dynamic Window with a URL"</title>

<script language="JavaScript">
<!-- Hide

  var myBars = 'directories=yes,location=yes,menubar=yes';
      myBars += ',status=yes,titlebar=yes,toolbar=yes';
  var myOptions = 
       'scrollbars=yes,width=380,height=440,resizable=yes';  
  var myFeatures = myBars +','+myOptions;

  function openWindow() {

    var newWin = window.open('', 'myDoc', myFeatures);

    with (newWin.document) {

      writeln("<html>");
      writeln("<head>");
      writeln("<title>Dynamic HTML Page</title>");

      writeln("<script language='JavaScript'>");
      writeln(" function msg() {");
      writeln("  alert('Hello'); }");
      writeln("</script>");

      writeln("<style type='text/css'>");
      writeln(" body { font-family: arial;");
      writeln("        font-size: 10pt; ");
      writeln("        color: yellow; ");
      writeln("        background: red; }");
      writeln("</style>");

      writeln("</head>");
      writeln("<body>");

      writeln("<h3>This is a Dynamic Page</h3><br />");

      writeln("<br /><br />");

      writeln("<form name='form1'>");

      writeln("<input type=button value='Display Message'");
      writeln("name='DisplayMessage'");
      writeln("onclick='msg()'>");

      writeln("<br /><br />");

      writeln("<input type=button value='Close Window'");
      writeln("name='CloseWin'");
      writeln("onclick='self.close()'>");

      writeln("</form>");

      writeln("</body>");
      writeln("</html>");

      close();
    } 
  }

// -->
</script>
</head>

<body>
<form name="form1">
<input type = "button" 
   name="openWin" value="Open Window" onclick="openWindow()">  
</form>

</body>     
</html> 

This will create a dynamic page which is what I believe you are requesting. Let me know.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-24-2007, 01:57 PM
domestic's Avatar   
domestic domestic is offline
Learning Programmer
 
Join Date: Mar 2007
Location: SCOTLAND!
Age: 20
Posts: 39
Credits: 0
Rep Power: 6
domestic is on a distinguished road
Default

Cheers chan! Wasn't 100% wha I was looking for, but it DOES allow me to do what I wanted so thats awesome!

Thanks!
__________________
.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS

Website:
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Opportunity is missed by most people because it is dressed in overalls and looks like work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-24-2007, 02:48 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,302
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Quote:
Originally Posted by domestic View Post
Cheers chan! Wasn't 100% wha I was looking for
What else do you need? I may be able to help.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Don't hesitate to ask any questions that you have! Check out our
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2007, 05:43 PM
domestic's Avatar   
domestic domestic is offline
Learning Programmer
 
Join Date: Mar 2007
Location: SCOTLAND!
Age: 20
Posts: 39
Credits: 0
Rep Power: 6
domestic is on a distinguished road
Default

Well, it wasnt what I had thought of originally, but it turns out this works BEAUTIFULLY. All I had to do was at "writeln(tt);" to add the tacktime to the window.

However, I do have another question and I guess ill just stick it here.

I'm trying to insert text into a table. Basically, instead of opening a new window, to insert the text into a table. I guess I would do this by adding a textarea into the table and then calling it to write into this. I think I know how to do this but, by all means, send me the code. Also, when done, I'll stick up a link to the finished content. Just so you can see how it worked out

Thanks guys!
__________________
.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS

Website:
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Opportunity is missed by most people because it is dressed in overalls and looks like work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 04-24-2007, 06:11 PM
domestic's Avatar   
domestic domestic is offline
Learning Programmer
 
Join Date: Mar 2007
Location: SCOTLAND!
Age: 20
Posts: 39
Credits: 0
Rep Power: 6
domestic is on a distinguished road
Default

OK, well screw what I said above. I kinda got it working but now my problem is that when I insert the text into the textfield it disappears the second. And I have no idea why!!!
__________________
.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS

Website:
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Opportunity is missed by most people because it is dressed in overalls and looks like work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-24-2007, 06:26 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,302
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

How are you writing it? It should look like:

HTML Code:
document.formName.textBoxName.value = "Text";
And your HTML would look like:

HTML Code:
<form name="formName">
<textarea name="textBoxName"></textarea>
</form>
Can you post your code?
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Don't hesitate to ask any questions that you have! Check out our
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-24-2007, 09:56 PM
domestic's Avatar   
domestic domestic is offline
Learning Programmer
 
Join Date: Mar 2007
Location: SCOTLAND!
Age: 20
Posts: 39
Credits: 0
Rep Power: 6
domestic is on a distinguished road
Default

Cheers Jordan.

Ok the finished "product" is online here:Teknek Task Timer

And I can post the code here if you want.
__________________
.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS

Website:
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Opportunity is missed by most people because it is dressed in overalls and looks like work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-27-2007, 08:53 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,302
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Nice looking! Good Job!
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Don't hesitate to ask any questions that you have! Check out our
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-29-2007, 04:15 AM
domestic's Avatar   
domestic domestic is offline
Learning Programmer
 
Join Date: Mar 2007
Location: SCOTLAND!
Age: 20
Posts: 39
Credits: 0
Rep Power: 6
domestic is on a distinguished road
Default

Just in case anyone cares, its now all just one page and has outputs on screen rather than the dynamic window. Thanks all the same Chan - I think they look cooler bt then again, what the boss says goes!

Cheers guys!
__________________
.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS

Website:
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Opportunity is missed by most people because it is dressed in overalls and looks like work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
! Need urgent help ! Drawing program using cygwin siren C and C++ 0 05-26-2007 10:51 PM
Creating a Custom Cursor ahsan16 Tutorials 2 01-13-2007 05:03 PM
Java:Tutorial - Adding more objects to your window John Java Tutorials 0 01-11-2007 02:09 PM
Java:Tutorial - Making A Window John Java Tutorials 0 01-11-2007 02:02 PM
Which Linux Window Manager do you use? Dan General Programming 5 07-03-2006 10:42 AM


All times are GMT -5. The time now is 03:18 AM.

Contest Stats

Xav ........ 1276.19
MeTh0Dz|Reb0rn ........ 1048.58
morefood2001 ........ 879.43
John ........ 872.39
marwex89 ........ 869.98
WingedPanther ........ 761.06
Brandon W ........ 684.87
chili5 ........ 294.12
Steve.L ........ 216.18
dargueta ........ 192.86

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 81%

Ads