JavaScript calculations
<p>Here is the updated version of my code. I can see the values for p // pay rate and m // markup % only in the console of the browser they aren't showing up in the assigned fields of the form loandata. </p>

<pre><code>var b, p, m, pmp, pm, pb, fp, misc, wc, tax, sui, o, fp, misc, t;
function calculate1(){
    wc = document.set.wc.value; // workers comp %
    tax = document.set.tax.value; // taxes %
    sui = document.set.sui.value; // sui %
    o = document.set.o.value; // other expenses %
    fp =document.set.fp.value; // fund and processing %
    misc = document.set.misc.value; // Misc expenses %
    pb = (wc+tax+sui+o)/100*b; // variable used to calculate profit margin
    document.set.pb.value = pb;
    t = document.set.t.value; // target profit margin %
}
function calculate() {
    b = document.loandata.b.value; //bill rate
    b = (b=="")?(((m*p)/ 100) + p):b; 
    p = document.loandata.p.value; //pay rate 
    m = document.loandata.m.value; // markup % 
    m = (m=="")?((b-p)/p* 100):m;
    pm = (b-((pb*p)/100+(b*fp)/100+(b*misc)/100+p)); // profit margin calculation
    pm = Math.round(pm).toFixed(2);
    document.loandata.pm.value = pm;
    pmp = pm/b*100;  // profit margin % calc 
    pmp = Math.round(pmp).toFixed(2); // profit margin %
    document.loandata.pmp.value = pmp;
}
</code></pre>
