|
||||||
| Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I know absolutely nothing about javascript.
Can Someone help me. I have two scripts 1 in the Head:<script type="text/javascript" src="budget.js"></script> 1 in the Body: <script language="JavaScript" src="header.js"></script> When I remove the header.js, my calculator works When I remove the budget.js, my header works Can someone tell me how I can change the code so the they both work? Thank You, Michele |
| Sponsored Links |
|
|
|
|||
|
Calculator Source Code:
Code:
// This Calculator generated by the // Budget Calculator Generator Javascript // at http://javascript.about.com/library/blbudget.htm function stripBlanks(fld) {var result = "";var c = 0;for (i=0; i < fld.length; i++) {if (fld.charAt(i) != " " || c > 0){ result += fld.charAt(i); if (fld.charAt(i) != " ") c = result.length;}} return result.substr(0,c);} function budget(thisform) { var result = 0; var in1 = stripBlanks(thisform.in1.value); if (in1 != '' && in1 != parseFloat(in1)) {alert("Income must be numeric");thisform.in1.focus();return false;} result += Number(in1); var in2 = stripBlanks(thisform.in2.value); if (in2 != '' && in2 != parseFloat(in2)) {alert("Other Income must be numeric");thisform.in2.focus();return false;} result += Number(in2); var ex01 = stripBlanks(thisform.ex01.value); if (ex01 != '' && ex01 != parseFloat(ex01)) {alert("Rent/Mortgage must be numeric");thisform.ex01.focus();return false;} result -= Number(ex01); var ex02 = stripBlanks(thisform.ex02.value); if (ex02 != '' && ex02 != parseFloat(ex02)) {alert("Property Tax/Ins must be numeric");thisform.ex02.focus();return false;} result -= Number(ex02); var ex03 = stripBlanks(thisform.ex03.value); if (ex03 != '' && ex03 != parseFloat(ex03)) {alert("Electricity/Gas must be numeric");thisform.ex03.focus();return false;} result -= Number(ex03); var ex04 = stripBlanks(thisform.ex04.value); if (ex04 != '' && ex04 != parseFloat(ex04)) {alert("Water/Trash must be numeric");thisform.ex04.focus();return false;} result -= Number(ex04); var ex05 = stripBlanks(thisform.ex05.value); if (ex05 != '' && ex05 != parseFloat(ex05)) {alert("Food must be numeric");thisform.ex05.focus();return false;} result -= Number(ex05); var ex06 = stripBlanks(thisform.ex06.value); if (ex06 != '' && ex06 != parseFloat(ex06)) {alert("Alcohol/Tobacco must be numeric");thisform.ex06.focus();return false;} result -= Number(ex06); var ex07 = stripBlanks(thisform.ex07.value); if (ex07 != '' && ex07 != parseFloat(ex07)) {alert("Entertainment must be numeric");thisform.ex07.focus();return false;} result -= Number(ex07); var ex08 = stripBlanks(thisform.ex08.value); if (ex08 != '' && ex08 != parseFloat(ex08)) {alert("Child Care must be numeric");thisform.ex08.focus();return false;} result -= Number(ex08); var ex09 = stripBlanks(thisform.ex09.value); if (ex09 != '' && ex09 != parseFloat(ex09)) {alert("Child Support must be numeric");thisform.ex09.focus();return false;} result -= Number(ex09); var ex10 = stripBlanks(thisform.ex10.value); if (ex10 != '' && ex10 != parseFloat(ex10)) {alert("Life/Health Ins must be numeric");thisform.ex10.focus();return false;} result -= Number(ex10); var ex11 = stripBlanks(thisform.ex11.value); if (ex11 != '' && ex11 != parseFloat(ex11)) {alert("Car Loan must be numeric");thisform.ex11.focus();return false;} result -= Number(ex11); var ex12 = stripBlanks(thisform.ex12.value); if (ex12 != '' && ex12 != parseFloat(ex12)) {alert("Auto Insurance must be numeric");thisform.ex12.focus();return false;} result -= Number(ex12); var ex13 = stripBlanks(thisform.ex13.value); if (ex13 != '' && ex13 != parseFloat(ex13)) {alert("Transportation must be numeric");thisform.ex13.focus();return false;} result -= Number(ex13); var ex14 = stripBlanks(thisform.ex14.value); if (ex14 != '' && ex14 != parseFloat(ex14)) {alert("Credit Card Pmts must be numeric");thisform.ex14.focus();return false;} result -= Number(ex14); var ex15 = stripBlanks(thisform.ex15.value); if (ex15 != '' && ex15 != parseFloat(ex15)) {alert("Installment Loans must be numeric");thisform.ex15.focus();return false;} result -= Number(ex15); var ex16 = stripBlanks(thisform.ex16.value); if (ex16 != '' && ex16 != parseFloat(ex16)) {alert("Miscellaneous must be numeric");thisform.ex16.focus();return false;} result -= Number(ex16); var ex17 = stripBlanks(thisform.ex17.value); if (ex17 != '' && ex17 != parseFloat(ex17)) {alert("Telephone/Cell must be numeric");thisform.ex17.focus();return false;} result -= Number(ex17); var ex18 = stripBlanks(thisform.ex18.value); if (ex18 != '' && ex18 != parseFloat(ex18)) {alert("Cable must be numeric");thisform.ex18.focus();return false;} result -= Number(ex18); var ex19 = stripBlanks(thisform.ex19.value); if (ex19 != '' && ex19 != parseFloat(ex19)) {alert("Computer/Internet must be numeric");thisform.ex19.focus();return false;} result -= Number(ex19); var ex20 = stripBlanks(thisform.ex20.value); if (ex20 != '' && ex20 != parseFloat(ex20)) {alert("Savings must be numeric");thisform.ex20.focus();return false;} result -= Number(ex20); thisform.res.value = result;} Header Source Code: do***ent.write('<nobr><img src="picts/top_bar.jpg" width="305" height="60" vspace="3"><a href="http://prosperonline.us/"><img src="picts/banner.jpg" width="468" height="60" border="0" vspace="3"></a></nobr><br>'); do***ent.write('<!-- TB 1 -->'); do***ent.write('<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>'); do***ent.write('<td width="278" height="78">'); do***ent.write('<table border="0" cellspacing="12" cellpadding="0" width="283" height="78" bgcolor="000000" background="picts/logo.gif"><tr><td valign="center" align="left">'); do***ent.write('<a href="index.html" cl***="logo">Virtual Lending Group</a><br>'); do***ent.write('<SPAN CL***="slogan">"Helping Borrowers Make It Happen"<br><br>'); do***ent.write('</td></tr></table>'); do***ent.write('</td><td align="right" valign="top" background="picts/top-background.gif">'); do***ent.write('<!-- LINK TABLE-->'); do***ent.write('<table border="0" cellspacing="0" cellpadding="2"><tr><td colspan="6">'); do***ent.write('<img src="picts/spacer.gif" width="50" height="9"><br>'); do***ent.write('</td></tr><form action="index.html"><tr><td>'); do***ent.write('<input type="submit" value="Home" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>'); do***ent.write('</td></form><form action="borrow.html"><td>'); do***ent.write('<input type="submit" value="Borrow" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>'); do***ent.write('</td></form><form action="lend.html"><td>'); do***ent.write('<input type="submit" value="Lend" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>'); do***ent.write('</td></form><form action="listing.html"><td>'); do***ent.write('<input type="submit" value="Listings" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>'); do***ent.write('</td></form><form action="Budget.html"><td>'); do***ent.write('<input type="submit" value="Calculator" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>'); do***ent.write('</td></form><form action="contact.html"><td>'); do***ent.write('<input type="submit" value="Contact" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>'); do***ent.write('</td></tr></table>'); do***ent.write('<!-- LINK TABLE-->'); do***ent.write('</td><td align="right" width="15">'); do***ent.write('<img src="picts/top-end.gif" width="15" height="78"><br>'); do***ent.write('</td></tr></table>'); do***ent.write('<!-- TB 1 -->'); Last edited by Jordan; 10-17-2006 at 09:23 AM. |
|
|||||
|
Can you post the header.js source code as well and possibly a link to the webpage where it isn't working?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||
|
I just uploaded the HTML to web site.....the site is not live yet:
http://www.prosperonline.us/budgetoriginal.html Thank You, Michele Code:
do***ent.write('<nobr><img src="picts/top_bar.jpg" width="305" height="60" vspace="3"><a href="http://prosperonline.us/"><img src="picts/banner.jpg" width="468" height="60" border="0" vspace="3"></a></nobr><br>');
do***ent.write('<!-- TB 1 -->');
do***ent.write('<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>');
do***ent.write('<td width="278" height="78">');
do***ent.write('<table border="0" cellspacing="12" cellpadding="0" width="283" height="78" bgcolor="000000" background="picts/logo.gif"><tr><td valign="center" align="left">');
do***ent.write('<a href="index.html" cl***="logo">Virtual Lending Group</a><br>');
do***ent.write('<SPAN CL***="slogan">"Helping Borrowers Make It Happen"<br><br>');
do***ent.write('</td></tr></table>');
do***ent.write('</td><td align="right" valign="top" background="picts/top-background.gif">');
do***ent.write('<!-- LINK TABLE-->');
do***ent.write('<table border="0" cellspacing="0" cellpadding="2"><tr><td colspan="6">');
do***ent.write('<img src="picts/spacer.gif" width="50" height="9"><br>');
do***ent.write('</td></tr><form action="index.html"><tr><td>');
do***ent.write('<input type="submit" value="Home" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>');
do***ent.write('</td></form><form action="borrow.html"><td>');
do***ent.write('<input type="submit" value="Borrow" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>');
do***ent.write('</td></form><form action="lend.html"><td>');
do***ent.write('<input type="submit" value="Lend" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>');
do***ent.write('</td></form><form action="listing.html"><td>');
do***ent.write('<input type="submit" value="Listings" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>');
do***ent.write('</td></form><form action="Budget.html"><td>');
do***ent.write('<input type="submit" value="Calculator" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>');
do***ent.write('</td></form><form action="contact.html"><td>');
do***ent.write('<input type="submit" value="Contact" onmouseover="this.cl***Name=\'buttonon\'" onmouseout="this.cl***Name=\'button\'" cl***="button"><br>');
do***ent.write('</td></tr></table>');
do***ent.write('<!-- LINK TABLE-->');
do***ent.write('</td><td align="right" width="15">');
do***ent.write('<img src="picts/top-end.gif" width="15" height="78"><br>');
do***ent.write('</td></tr></table>');
do***ent.write('<!-- TB 1 -->');
Last edited by Jordan; 10-17-2006 at 05:41 PM. |
|
|||||
|
Its possible the header was created to just use as an include. If that is the case you can just simply use ssi or PHP to include the header.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||||
|
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||
|
Thank you, I didn't know what ssi was, duh....I thought you means social security...so I looked it up and it looks fairly simple.....thank you for all your help....I will try the PHP tonight.......Michele
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| World in Conflict Trailer | Onur | Video Game Talk | 0 | 08-14-2007 05:59 AM |
| Shell Scripting | NeedHelp | General Programming | 9 | 04-16-2007 11:04 AM |
| Shell Scripting Problem | Chan | General Programming | 3 | 03-22-2007 11:59 AM |
| Processor Conflict??? | xXHalfSliceXx | Computer Software/OS | 3 | 12-01-2006 12:10 PM |
| Xav | ........ | 1322.18 |
| MeTh0Dz|Reb0rn | ........ | 1053.7 |
| morefood2001 | ........ | 879.43 |
| John | ........ | 877.37 |
| marwex89 | ........ | 869.98 |
| WingedPanther | ........ | 830.24 |
| Brandon W | ........ | 735.07 |
| chili5 | ........ | 309.39 |
| Steve.L | ........ | 236.23 |
| dcs | ........ | 216.02 |
Goal: 100,000 Posts
Complete: 82%