Ok, as you can tell, i'm a newbie Hence why i'm here!
I have created a PHP form with HTML and Javascript all on the page.
Now, I am having problems with a variable that does not seem to be defined according to my java script.
here is the code for the Variable, it is in HTML but echoed threw PHP:
===========PHP CODE====================
echo "<TR bgColor=#cccccc>
<TD> </TD>
<TD colSpan=45 align=right><B>TOTAL</B></TD>
<TD colSpan=10 align=center><input size=15 name=ProfTotalOne></TD>
<TD ColSpan=10 align=center><input size=15 name=ProfTotalTwo></TD>
<TR>
<TD> </TD>
<TD colSpan=45></TD>
<TD colSpan=10 align=center>
<INPUT type=BUTTON name=CalcButtonOne value=Calculate onClick=Calc(1);>
</TD>
<TD colSpan=10 align=center>
<INPUT type=BUTTON name=CalcButtonTwo value=Calculate onClick=Calc(2);>
</TD>";
===========END PHP CODE====================
Ok here is the JAVASCRIPT that is requesting the use of the variable that is used in the code above
============JAVASCRIPT=====================
ProfTotalOne.value = avg(countAvailable(selCollection),selCollection) + "%";
===========END JAVASCRIPT===================
For some reason when I run this code, my javascript keeps telling me that my variable <b>ProfTotalOne</b> is undefined.
Why?
I have other HTML variables that i create using PHP when i load the form up and they work fine. This is a text feild and it doesn't want to work.
Thanx in advance
Ulysses