eliktris Posted April 29, 2009 Share Posted April 29, 2009 Hi there, i am an extreme newbie to Javascript and know basically nothing about it.. i have a current client that i have volunteered my time for. things are getting to be a bit tedious and can only imagine it will get worse as it gets closer to the event.. anyhow i'm hoping someone here can help me (i'm begging!!), basically what i have a counter on a page that with each registration for a particular event, i manually go and update the counter on how many participants it is going to have (on a separate page from the registration) i'm hoping that what can be done, is for each time someone hits submit, that i can have it automatically increase the number by 1. i was originally thinking it was a php script (i'm just starting with that one) but someone on the php forum here suggested it should/could be done with javascript. anyone have any advice?? thanks so much in advance eliktris Quote Link to comment Share on other sites More sharing options...
Helmet Posted April 29, 2009 Share Posted April 29, 2009 No, you can't do that with Javascript alone because you need to save the values. Javascript runs on a user's browser and would need to interact with a server-side script to get the latest number. You need a php script that queries the database for the total number of rows in the registration table. You can use asynchronous javascript to get that value from the php script and update the number on the screen at regular intervals if the user is sitting on the page long enough. I suggest you use a javascript library for this, like Mootools. Look into Request and Periodical. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.