I'm trying to refresh textboxes with values received from cgi scripts. I use php code within javascript that calls cgi scripts. So textboxes are refreshed every second with values received from cgi script. Example (javascript and php code set value in textbox received from cgi script): document.getElementById("id11").value= <? echo system(/home/apache/cgi-bin/id11.cgi'); ?>; But textboxes are always refreashed with values received from cgi scripts when they are called for the first time. If cgi script returns value 5 when it is called first time and written in textbox, then this value (5) will be written in textbox every next second. Correct value is written again in textbox when I refresh web page, but only when cgi is called for the first time. From there on the old value is written in textbox every next second again. How to solve this problem?
make a function and call it with setTimeout('myfunction()', 1000); Code (markup): and function myfunction() { document.getElementById("id11").value= <? echo system(/home/apache/cgi-bin/id11.cgi'); ?>; } Code (markup): it should work