views:

119

answers:

2

I have a form that performs 3 separate tasks when submitted. When the form is submitted, a lightbox/thickbox window appears to show the status.

The page posts to itself, and as it completes a task, it writes to the database containing a 'status' field.

All this is working fine.

I need the current status to appear/refresh in the lightbox, but it's just showing up blank.

I've read that you can't have more than 2 requests going simultaneously, but I can't even seem to get 2 working.

I use MooTools, but if you know a good way to do this using an iframe (or something) or another library like jQuery, I'm more than willing to switch.

I've been battling with this for awhile now and I can't seem to get it working for the life of me. Is there a tutorial on doing something like this?

+2  A: 

Instead of keeping an everloading iframe for each task, why don't you poll (with XMLHttpRequest) the status of each task in order periodically?

shinkou
All I'm trying to do is get the text from the status field in the database while the form is being processed, and for some reason, it doesn't work. It doesn't show anything until the form has finished processing, like it can't handle 2 requests at once.
It could be due to record locked in the database. If the process locks both read and write access to the record until it finishes, any query to the record will fail. So, you'd better check that out too.
shinkou
Does MySQL have that problem? That would seem disastrous in a large application.
I tested using a standard text file to store the status, and it works. Thanks shinkou, I never would have thought of that.
A: 

I tested using a standard text file to store the status, and it works. Thanks shinkou, I never would have thought of that.

It could be due to record locked in the database. If the process locks both read and write access to the record until it finishes, any query to the record will fail. So, you'd better check that out too.

No problem. I'm glad it helped. :)
shinkou