|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Need help with c squared=a squared*b squared |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|