Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Scripting Conflict Help

  1. #1
    thunderbucks is offline Newbie
    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0

    Scripting Conflict Help

    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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    thunderbucks is offline Newbie
    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0

    Source codes for java clash

    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: 
    document.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>');
    document.write('<!-- TB 1 -->');
    document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>');
    document.write('<td width="278" height="78">');
    document.write('<table border="0" cellspacing="12" cellpadding="0" width="283" height="78" bgcolor="000000" background="picts/logo.gif"><tr><td valign="center" align="left">');
    
    document.write('<a href="index.html" class="logo">Virtual Lending Group</a><br>');
    
    document.write('<SPAN CLASS="slogan">"Helping Borrowers Make It Happen"<br><br>');
    
    document.write('</td></tr></table>');
    
    document.write('</td><td align="right" valign="top" background="picts/top-background.gif">');
    document.write('<!-- LINK TABLE-->');
    document.write('<table border="0" cellspacing="0" cellpadding="2"><tr><td colspan="6">');
    document.write('<img src="picts/spacer.gif" width="50" height="9"><br>');
    
    document.write('</td></tr><form action="index.html"><tr><td>');
    document.write('<input type="submit" value="Home" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="borrow.html"><td>');
    document.write('<input type="submit" value="Borrow" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="lend.html"><td>');
    document.write('<input type="submit" value="Lend" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="listing.html"><td>');
    document.write('<input type="submit" value="Listings" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="Budget.html"><td>');
    document.write('<input type="submit" value="Calculator" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="contact.html"><td>');
    document.write('<input type="submit" value="Contact" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></tr></table>');
    document.write('<!-- LINK TABLE-->');
    document.write('</td><td align="right" width="15">');
    document.write('<img src="picts/top-end.gif" width="15" height="78"><br>');
    document.write('</td></tr></table>');
    document.write('<!-- TB 1 -->');
    Last edited by Jordan; 10-17-2006 at 07:23 AM.

  4. #3
    Jordan Guest
    Can you post the header.js source code as well and possibly a link to the webpage where it isn't working?

  5. #4
    thunderbucks is offline Newbie
    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0

    Thank U for any input....Michele

    I just uploaded the HTML to web site.....the site is not live yet:
    http://www.prosperonline.us/budgetoriginal.html
    Thank You,
    Michele

    Code:
    document.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>');
    document.write('<!-- TB 1 -->');
    document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>');
    document.write('<td width="278" height="78">');
    document.write('<table border="0" cellspacing="12" cellpadding="0" width="283" height="78" bgcolor="000000" background="picts/logo.gif"><tr><td valign="center" align="left">');
    
    document.write('<a href="index.html" class="logo">Virtual Lending Group</a><br>');
    
    document.write('<SPAN CLASS="slogan">"Helping Borrowers Make It Happen"<br><br>');
    
    document.write('</td></tr></table>');
    
    document.write('</td><td align="right" valign="top" background="picts/top-background.gif">');
    document.write('<!-- LINK TABLE-->');
    document.write('<table border="0" cellspacing="0" cellpadding="2"><tr><td colspan="6">');
    document.write('<img src="picts/spacer.gif" width="50" height="9"><br>');
    
    document.write('</td></tr><form action="index.html"><tr><td>');
    document.write('<input type="submit" value="Home" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="borrow.html"><td>');
    document.write('<input type="submit" value="Borrow" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="lend.html"><td>');
    document.write('<input type="submit" value="Lend" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="listing.html"><td>');
    document.write('<input type="submit" value="Listings" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="Budget.html"><td>');
    document.write('<input type="submit" value="Calculator" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></form><form action="contact.html"><td>');
    document.write('<input type="submit" value="Contact" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'" class="button"><br>');
    
    document.write('</td></tr></table>');
    document.write('<!-- LINK TABLE-->');
    document.write('</td><td align="right" width="15">');
    document.write('<img src="picts/top-end.gif" width="15" height="78"><br>');
    document.write('</td></tr></table>');
    document.write('<!-- TB 1 -->');
    Last edited by Jordan; 10-17-2006 at 03:41 PM.

  6. #5
    Saint is offline Learning Programmer
    Join Date
    Aug 2006
    Posts
    63
    Rep Power
    0
    So the header.js is only outputting html? Why even have a header.js then?
    Hi >> Saint

  7. #6
    thunderbucks is offline Newbie
    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0
    That's an excellent question. It came with the kit. I could remove the header and set all the pages up. Honestly, I never though of that...Thank You.....Michele

  8. #7
    Jordan Guest
    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.

  9. #8
    thunderbucks is offline Newbie
    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0
    Thank U Jordan, Which one would you recommend? Michele Remember, I have very little experience......

  10. #9
    Jordan Guest
    PHP

    Here is a thread about including in PHP
    http://forum.codecall.net/tutorials-...p-include.html

  11. #10
    thunderbucks is offline Newbie
    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0
    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

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 10-20-2011, 05:57 PM
  2. World in Conflict Trailer
    By Onur in forum Video Game Talk
    Replies: 0
    Last Post: 08-14-2007, 03:59 AM
  3. Shell Scripting
    By NeedHelp in forum General Programming
    Replies: 9
    Last Post: 04-16-2007, 09:04 AM
  4. Processor Conflict???
    By xXHalfSliceXx in forum Computer Software/OS
    Replies: 3
    Last Post: 12-01-2006, 10:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts