Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Repair Script

  1. #1
    Join Date
    Oct 2017
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Repair Script

    1) Script Title:

    2) Script URL (on DD):

    3) Describe problem: I need help in fixing this script

    Code:
    <style type="text/css"></style>
    
    #hintbox{ /*CSS for pop up hint box */
    position:absolute;
    top: 0;
    background-color: lightgrey;
    width: 150px; /*Default width of hint.*/ 
    padding: 3px;
    border:1px solid black;
    font:normal 12px Arial;
    line-height:18px;
    z-index:100;
    border-right: 3px solid black;
    border-bottom: 3px solid black;
    visibility: hidden;
    }
    
    .hintanchor{ /*CSS for link that shows hint onmouseover*/
    font-weight: bold;
    color: navy;
    margin: 3px 8px;
    }
    
    
    
    &lt;script type="text/javascript"&gt;
    
    /***********************************************
    * Show Hint script- � Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for this script and 100s more.
    ***********************************************/
    		
    var horizontal_offset="9px" //horizontal offset of hint box from anchor link
    
    /////No further editting needed
    
    var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
    var ie=document.all
    var ns6=document.getElementById&amp;&amp;!document.all
    
    function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }
    
    function iecompattest(){
    return (document.compatMode &amp;&amp; document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    
    function clearbrowseredge(obj, whichedge){
    var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
    if (whichedge=="rightedge"){
    var windowedge=ie &amp;&amp; !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x &lt; dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
    }
    else{
    var windowedge=ie &amp;&amp; !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y &lt; dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
    }
    return edgeoffset
    }
    
    function showhint(menucontents, obj, e, tipwidth){
    if ((ie||ns6) &amp;&amp; document.getElementById("hintbox")){
    dropmenuobj=document.getElementById("hintbox")
    dropmenuobj.innerHTML=menucontents
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    if (tipwidth!=""){
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=tipwidth
    }
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
    dropmenuobj.style.visibility="visible"
    obj.onmouseout=hidetip
    }
    }
    
    function hidetip(e){
    dropmenuobj.style.visibility="hidden"
    dropmenuobj.style.left="-500px"
    }
    
    function createhintbox(){
    var divblock=document.createElement("div")
    divblock.setAttribute("id", "hintbox")
    document.body.appendChild(divblock)
    }
    
    if (window.addEventListener)
    window.addEventListener("load", createhintbox, false)
    else if (window.attachEvent)
    window.attachEvent("onload", createhintbox)
    else if (document.getElementById)
    window.onload=createhintbox
    
    &lt;/script&gt;
    
    
    
    
    
    &lt;script language="JavaScript"&gt;
    <!-- Begin
    function calc_headroom(form) {
    var mattress = form.mattress.value;
    var ceiling = form.ceiling.value;
    var above = form.above.value;
    var leg691 = 0
    var leg692 = 0
    var leg831 = 0
    var leg832 = 0
    var trim691 = 0
    var trim692 = 0
    var trim831 = 0
    var trim832 = 0
    var underceiling = (ceiling - above - mattress - 3);
    
    form.under691.value = (69 - 5 - mattress - 3);
    if (underceiling < form.under691.value) (form.under691.value = underceiling);
    form.under831.value = (83 - 5 - mattress - 3);
    if (underceiling < form.under831.value) (form.under831.value = underceiling);
    form.under692.value = (69 - 10 - mattress - 3);
    if (underceiling < form.under692.value) (form.under692.value = underceiling);
    form.under832.value = (83 - 10 - mattress - 3);
    if (underceiling < form.under832.value) (form.under832.value = underceiling);
    
    form.a691.value = (ceiling - mattress - 3 - form.under691.value);
    form.a831.value = (ceiling - mattress - 3 - form.under831.value);
    form.a692.value = (ceiling - mattress - 3 - form.under692.value);
    form.a832.value = (ceiling - mattress - 3 - form.under832.value);
    
    leg691 = -(-3 - mattress - 5 - form.under691.value);
    leg831 = -(-3 - mattress - 5 - form.under831.value);
    leg692 = -(-3 - mattress - 10 - form.under692.value);
    leg832 = -(-3 - mattress - 10 - form.under832.value);
    
    trim691 = 69 - leg691;
    trim831 = 83 - leg831;
    trim692 = 69 - leg692;
    trim832 = 83 - leg832;
    
    form.top691.value = leg691 - 5;
    form.top831.value = leg831 - 5;
    form.top692.value = leg692 - 10;
    form.top832.value = leg832 - 10;
    
    minabove30 = "Suggestion: We recommend the Minimum Headroom Above the Mattress is 30 inches.";
    mattresszero = "Error: The Mattress Thickness must be greater than zero";
    mattress40 = "Error: The Mattress Thickness must be less than 40 inches";
    
    if (mattress < 1) alert(mattresszero);  // mattress must be greater than zero
    if (mattress > 40) alert(mattress40); // mattress can't be greater then 40
    if (above < 10) alert(minabove30);  // minimum headroom above is 30
    
    }
    //  End -->
    &lt;/script&gt;
    
    <center>
    <form method="POST">
    
    
    <table bgcolor="#ffffff" width="550" border="0" cellpadding="0" cellspacing="0">
    <tbody><tr>
    <td><h2>Height Calculator</h2>
      <h4>How much headroom will I get?<br/>
        Enter your specifications below and then press Calculate Headroom. </h4></td>
    </tr>
    <tr>
    <td>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tbody><tr>
    <td valign="top">
      <div>
    <table width="85%" align="center" cellpadding="2" cellspacing="2">
      <tbody><tr>
        <td width="74%">Total Mattress Thickness <a href="#" class="hintanchor" onmouseover="showhint('Enter the total thickness of the mattress and any mattress topper.', this, event, '200px')" style="text-decoration: none; vertical-align: middle; font-weight: 400;color:#900">[?]</a></td>
        <td width="26%"><input name="mattress" size="3" value="8" onfocus="select()" maxlength="2"/> inches</td>
      </tr>
      <tr>
        <td>Ceiling Height <a href="#" class="hintanchor" onmouseover="showhint('We need the ceiling height to calculate how much headroom you will get above and underneath.', this, event, '200px')" style="text-decoration: none; vertical-align: middle; font-weight: 400;;color:#900">[?]</a></td>
        <td><input name="ceiling" size="3" value="96" onfocus="select()"/> inches</td>
      </tr>
      <tr>
        <td>Minimum Headroom Above Mattress <a href="#" class="hintanchor" onmouseover="showhint('We recommend a minimum of 30 inches of headroom above.', this, event, '200px')" style="text-decoration: none; vertical-align: middle; font-weight: 400;;color:#900">[?]</a></td>
        <td><input name="above" size="3" value="30" onfocus="select()"/> inches</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" align="right"><input value="Reset" type="reset"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input value="Calculate Headroom" onclick="calc_headroom(this.form)" type="button"/></td>
        </tr>
    </tbody></table><br/> <br/> 
    
    <h2><strong></strong><center>Headroom Above &amp; Underneath the Mattress</center></h2><br/>
    
    <table width="75%" align="center" cellpadding="2" cellspacing="2">
      <tbody><tr>
        <td colspan="2"><strong>Using Standard Single Safety Rail</strong></td>
        </tr>
      <tr>
        <td><strong>69" Legs</strong></td>
        <td><strong>83" Legs</strong></td>
      </tr>
      <tr>
        <td>Above &nbsp;<input name="a691" value="44" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
        <td>Above &nbsp;<input name="a831" value="30" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
      </tr>
      <tr>
        <td>Underneath&nbsp;<input name="under691" value="56" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
        <td>Underneath&nbsp;<input name="under831" value="70" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
      </tr>
      <tr>
        <td>Top of Mattress&nbsp;<input name="top691" value="64" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
        <td>Top of Mattress&nbsp;<input name="top831" value="78" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2"><strong>Using Youth  Double Safety Rails</strong></td>
        </tr>
      <tr>
        <td>69" Legs</td>
        <td>83" Legs</td>
      </tr>
      <tr>
        <td>Above &nbsp;<input name="a692" value="49" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
        <td>Above&nbsp;<input name="a832" value="35" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
      </tr>
      <tr>
        <td>Underneath&nbsp;<input name="under692" value="51" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
        <td>Underneath&nbsp;<input name="under832" value="65" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
      </tr>
      <tr>
        <td>Top of Mattress&nbsp;<input name="top692" value="59" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/> </td>
        <td>Top of Mattress &nbsp;<input name="top832" value="73" size="3" style="color: rgb(255, 0, 0); font-weight: bold;"/></td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>    
      </tr>
      <tr>
    <td colspan="2" align="center"><input value="Return to Previous Page" onclick="javascript:history.back()" type="button"/></td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
      </tr>
    </tbody></table>
    
    <center>
      <p><img src="media/cms/html/loft_drawing_text.gif" width="485" border="0" height="339"/></p>
      <table width="100%" cellspacing="2" cellpadding="2">
        <tbody><tr>
          <td height="33%" align="center" valign="top"><h6>Standard 69" Legs<br/>Single Safety Rail<br/><img src="media/cms/html/loft_clear_100x97.jpg" width="100" height="97" alt="Standard 69&quot; Legs with Single Safetry Rail"/></h6></td>
          <td height="33%" align="center" valign="top"><h6>Extra Tall 83" Legs<br/>Single Safety Rail<br/><img src="media/cms/html/loft_extratall_100x111.jpg" width="100" height="111" alt="Extra Tall 83&quot; Legs with Single Safety Rail"/></h6></td>
          <td width="33%" align="center" valign="top"><h6>Standard 69" Legs<br/>Youth (Double) Safety Rails<br/><img src="media/cms/html/youth_sdc_1468x1480_small1.jpg" width="100" height="100" alt="Standard 69&quot; Legs with Youth (Double) Safety Rails"/></h6></td>
        </tr>
      </tbody></table>
      <p>&nbsp;</p>
    </center>
          
          
         </div></td>
    </tr>
    </tbody></table>
    </td>
    </tr>
    </tbody></table>
    
    </form></center>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    There could also be other problems but:

    Code:
    <style type="text/css"></style>
    
    #hintbox{ /*CSS for pop up hint box */
    position:absolute;
    top: 0;
    background-color: lightgrey;
    width: 150px; /*Default width of hint.*/ 
    padding: 3px;
    border:1px solid black;
    font:normal 12px Arial;
    line-height:18px;
    z-index:100;
    border-right: 3px solid black;
    border-bottom: 3px solid black;
    visibility: hidden;
    }
    
    .hintanchor{ /*CSS for link that shows hint onmouseover*/
    font-weight: bold;
    color: navy;
    margin: 3px 8px;
    }
    should be:

    Code:
    <style type="text/css">
    
    #hintbox{ /*CSS for pop up hint box */
    position:absolute;
    top: 0;
    background-color: lightgrey;
    width: 150px; /*Default width of hint.*/ 
    padding: 3px;
    border:1px solid black;
    font:normal 12px Arial;
    line-height:18px;
    z-index:100;
    border-right: 3px solid black;
    border-bottom: 3px solid black;
    visibility: hidden;
    }
    
    .hintanchor{ /*CSS for link that shows hint onmouseover*/
    font-weight: bold;
    color: navy;
    margin: 3px 8px;
    }
    </style>
    and:

    Code:
    &lt;script type="text/javascript"&gt;
    should be:

    Code:
    <script>
    and:

    Code:
    //  End -->
    &lt;/script&gt;
    should be:

    Code:
    //  End -->
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2017
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Not Fixed. Willing to Pay To Get It Fixed

    Willing to pay to get this script fixed.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    No need to do that, though perhaps. First, do what I suggest. If that's still not working, please post a link to the page on your site that shows what what you have so far.

    Also helpful - Where did you get this script? (please link to the page where you saw it on Dynamic Drive)
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Oct 2017
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here is a link to the page that it is displayed in: https://www.nationalhomestore.com/ste_heightcalculator

    It was done for me along time ago. Here is t he information about the script :

    /***********************************************
    * Show Hint script- � Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for this script and 100s more.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    OK, I just looked at the page you linked to with the height calculator and the hint script there seems to be working fine. Also, looks like you fixed the problems from before like I suggested. If it's still not working for you, try clearing the browser cache and refreshing the page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Oct 2017
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    If you increase the mattress thickness by 2" then the clearance should be decreased by 2". If you increase the ceiling height by 2" the clearance should be increased by 2". The script is not doing that.

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    That script never did that. It's a hint script, not a calculator script. The hints are now working. I'll have a closer look at it later though to see if the hint script was modified to take on calculator duties and that part is no longer working, or if there is another script, or perhaps nothing, attempting to do that part.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Oct 2017
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can you help when you get a chance?

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    OK, it seems to work to me, except for one problem, the initial values are wrong. That is if you assume that once you hit the calculate button the values are accurate. If so, from that point on they increment and decrement in ways that are consistent with the input.

    However, this one problem gives rise to two problems. First, when the page loads (really, just after the form is parsed), everything is out of sync, so the calc_headroom function should be run then in order to sync things up. And, when one hits reset, things go out of sync again, so the calc_headroom function should be run then as well.

    There are various ways of doing these two things, but I would suggest first giving the form a unique id, say - "calcform" (addition highlighted):

    Code:
    <center>
    <form method="POST" id="calcform">
    
    
    <table bgcolor="#ffffff" width="550" border="0" cellpadding="0" cellspacing="0">
    <tbody><tr>
    <td><h2>Height Calculator</h2>
      <h4>How much headroom will I get?<br />
        Enter your specificatio . . .
    Next, find the reset button and add the highlighted:

    Code:
    <td colspan="2" align="right"><input value="Reset" type="reset" onclick="setTimeout(function(){calc_headroom(document.getElementById('calcform'));}, 100); return true;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    Finally, after the form, add this short script as shown:

    Code:
    </tbody></table>
    </td>
    </tr>
    </tbody></table>
    
    </form></center>
    
    <script>
    calc_headroom(document.getElementById('calcform'));
    </script>
    </div>
    
    
    <div class="clearboth"></div>
    Save and use it like that.

    The browser cache may need to be emptied, and/or the page refreshed to see changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. JavaScript work repair and update needed -- URGENTLY
    By jaynoble in forum General Paid Work Requests
    Replies: 2
    Last Post: 08-21-2009, 03:41 AM

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
  •