Forum Moderators: open

Message Too Old, No Replies

Onblur problem Pls help

not recognising the form elements

         

vals

3:06 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



Hi I am calling this function onblur..Its working absolutely fine in my development server but after posting it in our production server its giving an error 'value' is null or not an object..Its working absolutely fine my machine..I tried document.form also in place of this.form

<input type="text" name="TRANS_LIMIT_<%=rsmes("MEASURE_SNAME")%>" size="8" onblur="calcPer(this.form.TOT_<%=rsmes("MEASURE_SNAME")%>,this,this.form.PER_TRANS_<%=rsmes("MEASURE_SNAME")%>,this.form.ROOT_CAUSE_<%=rsmes("MEASURE_SNAME")%>,<%=rsmes("GOAL")%>,<%=rsmes("LT")%>)" value="<%=detsod%>">

function calcPer(totval,detval,pval,pcom,plim,glim)
{
var perval=0;
var temval;

var pl;
var gl;
tval=totval.value;
alert(tval)
dval=detval.value;
pv=pval.value;

pc=pcom
pl=plim
gl=glim

tval= parseFloat( tval.replace( /[\,\$\s]/g, "" ) );
dval= parseFloat( dval.replace( /[\,\$\s]/g, "" ) );

if ( isNaN( tval ) ) tval = 0;
if ( isNaN( dval ) ) dval = 0;



if(tval=='')
{
pval.value=''
}

if(tval=='')
{
dval.value=''
}

if(!(tval==''))
{
tempval=(dval/tval)*100
pval.value=tempval
totval.value=tval
detval.value=dval


if((tempval< pl)¦¦(tempval==pl))
{
pc.style.backgroundColor = "red";
}

if((tempval>pl)¦¦(tempval==pl))
{
pc.style.backgroundColor = "green";
}


if((tempval<pl )&&(tempval>gl))
{
pc.style.backgroundColor = "yellow";
}



}


}

Purple Martin

10:38 pm on Mar 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your prod server is giving different outputs from your dev server, e.g. the output from <%=rsmes("MEASURE_SNAME")%> could be different.

View the rendered source code in the browser to see the output from each server, and compare them to see the differences.

The different outputs are caused by either differences in server-side script or differences in the data in a database.