The script that loads the div is:
--------------------------------------------------------
function scriptChain (evt, newDivID, chainToProgram, chainFromFormID) { // scriptChain //alert ("scriptChain: " + newDivID + " ->" + chainToProgram + " with>" + chainFromFormID +"<");
    stopBubble (evt);
    // if chainFromFormID is blank, use a chain without data
    if (chainFromFormID == "")   { // no data
//alert ("with no data");
        closeMenu2 () ;  // no harm if it does not need to be closede
        document.getElementById (newDivID).style.display = "block";
        new Ajax.Updater(newDivID, chainToProgram, {
        evalScripts:true
        });
        return false; //inhibit the href
        } //no data
    else   { // with data
        new Ajax.Updater(newDivID, chainToProgram, {
            parameters:  $(chainFromFormID).serialize(true),
            onFailure: function(response) {
alert ("patient.php: failure to submit form: " + chainFromFormID);
            },
        evalScripts:true
        });
        return false;
        } //with data
    } // scriptChain
---------------------------------------------------------------
and works fine
The page that I am loading has as a fragment:
------------------------------------------------------------------
<SCRIPT type="text/javascript">

window.reformat = function (t,d) {
   var     bal  = ( Math.round((t.value * 100) + .4))/100.0;
    t.value= FormatNumber(bal,2)
    return true
    }

window.recalc = function (t,d){
    reformat(t,d);
    //then recalc amount remaining
    var bal = t.form.amount.value
    bal -=t.form.amount1.value
    bal -=t.form.amount2.value
    bal -=t.form.amount3.value
    bal -=t.form.amount4.value
    bal -=t.form.amount5.value
    bal -=t.form.amount6.value

    t.form.amount_remaining.value = bal
    reformat(t.form.amount_remaining,2)
    if (t.form.amount_remaining.value< 0.0) { // error
alert ("ERROR, you can not distribute MORE than the amount of the payment")
        }
     }
</script>
------------------------------------------------------------
but when I call recalc, I get the error message: recalc is not defined.

thoughts/suggestions please
where did I go wrong ?

These are old scripts that I am using in the rewrite of an application, but should work.

--
Bill Drescher
william {at} TechServSys {dot} com

--
You received this message because you are subscribed to the Google Groups "Prototype 
& script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to