javascript return result by id.....
Posted: Sun Jul 26, 2009 8:36 am
Hey guys...
I was able to do real time two integer multiplication using ajax which is combination of php and javascript where by the result will return at the same page without refreshing or pressing a button.
the result returned by javascript declaring the id like ->> document.getElementById("tot").innerHTML=xmlhttp.responseText;
so...when i put <div id='tot'></div> back in my php page...it succesfully return the correct multiplication result...
the problem here is....i wanted to display the result in input field like this
<input type="varchar" name="num1" id="tot" />
but the result doesnt display in input field in the form...but in <div> tag it can be displayed...
does anyone know this?
thanks
azhan
I was able to do real time two integer multiplication using ajax which is combination of php and javascript where by the result will return at the same page without refreshing or pressing a button.
the result returned by javascript declaring the id like ->> document.getElementById("tot").innerHTML=xmlhttp.responseText;
so...when i put <div id='tot'></div> back in my php page...it succesfully return the correct multiplication result...
the problem here is....i wanted to display the result in input field like this
<input type="varchar" name="num1" id="tot" />
but the result doesnt display in input field in the form...but in <div> tag it can be displayed...
does anyone know this?
thanks
azhan