0

I have a php page, which has different forms. One of my forms contains a table of data. I want only this form (not the complete page) to be updated in a fixed period of time. How could I do this?

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by diafol
0

what do you mean? form has to be display in a period of time or the form has to be filled out in a period of time? If the latter:

1) have a php session variable set to the time of page served.
1) create a javascript countdown function to start on load page.
2) update a tag with the time remaining, say every second.
3) bind the submit button to a js script that checks the state of the countdown - send if in time, message if not.
4) coz forms can be spoofed and js switched off, ensure the form handling page gets the session variable so that anybody messing with the page won't be able to beat the system.

0

what do you mean? form has to be display in a period of time or the form has to be filled out in a period of time? If the latter:

1) have a php session variable set to the time of page served.
1) create a javascript countdown function to start on load page.
2) update a tag with the time remaining, say every second.
3) bind the submit button to a js script that checks the state of the countdown - send if in time, message if not.
4) coz forms can be spoofed and js switched off, ensure the form handling page gets the session variable so that anybody messing with the page won't be able to beat the system.

Sorry I meant the the former one. There is a table which displays data from a database. I want that table to be updated once in every minute automatically.

0

So you want an automatic refresh every minute?

1) Set a js timer to refresh the table every minute, i.e. the timer runs an ajax script to refresh the table data only.

I'd use jQuery for this so that you don't have to get dirty with the ajax object.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.