Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old October 21st, 2002, 05:25 PM
TracyD TracyD is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Atlanta GA
Posts: 15 TracyD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Need help with c squared=a squared*b squared

I need help with this Java Script problem. It is supposed to be able to solve the problem

c*c=a*a=B*b or c squared= a squared*bsquared

and I need the answer to pop up in a new page in a new javascript and have a close tag. (window.close)

I'm so lost...my second wk of javascript in school and I have NO idea what I'm doing. Could anyone please look at my code and help me?

Thanks,
Tracy

Here it is......


<html><head><title>Hypotenuse</title>

<script language="JavaScript">
<!--hide from old browsers
document.write("This is JavaScript")


function hypotenuse(){
a=c*c=(document.add.a*a.value)+
(document.add.b*b.value)
alert(a);


function newWindow(open) {
equation = window.open("open", "equation", "width=330,height=250");
equation.focus();
}


//-->
</script>
</head>
<body>
<form name="add">
<input type="text" name="a+a" value=""> enter side A.<br>
<input type="text" name="b+b" value=""> enter side B.<br>
<a href="javascript:newWindow(open)"></a>

<input type="button" value="submit"
onClick=" hypotenuse();">

</form>
</body></html>

Reply With Quote
  #2  
Old October 21st, 2002, 06:56 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
First off, please don't cross post. Not polite, you see .

Now, as for your code, you're close.

You're going to need two pages. The page you have is a good start for letting the user input data. The second page will need to take information from the form, perform the hypotenuse calculation, and display it.

Now, are you sure you have to open a new window to display your data? That seems a bit complex for your second week of javascript. Are you sure you don't have to just popup an alert dialog with an "OK" button? That's much, much easier.

Reply With Quote
  #3  
Old October 21st, 2002, 08:39 PM
TracyD TracyD is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Atlanta GA
Posts: 15 TracyD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
need to solve equation on new page

Thank you Bricker42 for your help. Sorry for the cross post. It's my very first time using a forum. I have to learn the ropes still.

I have to get the equation to solve and open up on a new JS page with the answer(no alert box). It needs to also have a "close this page" for the user (window.close)

do you have any suggestions about what I'm doing wrong in the code?

Thank you for your help...really appreciate it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Need help with c squared=a squared*b squared


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway