RE: Dynamic form changes without refresh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Mayer, Jonathan [mailto:jmayer@xxxxxxxxxxx]
> Sent: Thursday, June 05, 2008 7:18 AM
> To: 'php-general@xxxxxxxxxxxxx'
> Subject:  Dynamic form changes without refresh

---8<--- snip
 
> Using some basic javascript/AJAX, I have set up a link next to each
> text
> box, which calls code that updates the database in the background
> without
> refreshing the page. If I manually refresh the page, the textarea box
> in
> question updates correctly, proving that the database update has
> worked.
> However, I cannot work out how to get the textarea boxes to toggle the
> disable on/off "on the fly". I assume they would need to continually
> check
> the database and adjust as required.
> 
> I realise there may not be too much PHP involved here, but I was
> wondering
> whether anyone could assist or point me in the right direction.

There is actually no PHP involved beyond your AJAX response page, and
that is basic at most. What you will need to do if you want to
*continually* update your status is to use the javascript
"setInterval()" or "setTimeout()" method(s).

I recommend setInterval(), as it repeats itself at the specified time
interval. The function passed to setTimeout() would need to set a new
timeout every time it was executed.

Hope this helps.


Todd Boyd
Web Programmer




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux