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, {
        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);
        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){
    //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
    if (t.form.amount_remaining.value< 0.0) { // error
alert ("ERROR, you can not distribute MORE than the amount of the payment")
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 
&" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to