Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
02-02-2012, 06:46 AM #1
- Join Date
- Jan 2011
- Thanked 0 Times in 0 Posts
Multiple forms, on one page as a single function
I have been going round in circles trying raw ajax and a number of other methods and think the best thing to do is use jquery or similar but I am a little stuck.
I have a page that generates a table, each row of the table becomes a separate form. This is for a work roster style thing, that shows user statuses, such as at lunch, busy etc for a distributed team that I work in.
I am trying to make the page a little cleaner and use AJAX for the form processing as well as bringing in the content and refreshing it at regular intervals without the need to refresh the whole page.
Anyway the content would look like this
<table> <tr> <td><form id="user1form" name="user1form><select name="theaction"><option value="1">Available</option> <option value="2">At Lunch</option> </select> <input type="hidden" name="userid" id="userid" value="1"></td><td><input type="submit" name="submit" value="go"></td> </form> </tr> <tr> <td><form id="user2form" name="user2form><select name="theaction"><option value="1">Available</option> <option value="2">At Lunch</option> </select></td> <input type="hidden" name="userid" id="userid" value="2"> </form> <td><input type="submit" name="submit" value="go"></td> </tr> </table>
Now I want to use a single ajax function to process which ever form has been updated, update the database and then reload the data on the page.
Looking at a basic JQuery example I would use something like
Also likely I wouldn't need the validation stuff
Is this even possible?
Last edited by Dannymh; 02-02-2012 at 06:52 AM.