views:

52

answers:

2

I have some web forms that I'm bringing over with AJAX, and as I was dealing with the database on the back end, I thought that it might be easier to just handle each input on the form atomically with AJAX, saving the form in 'real time' as the user edits it. The forms are ~20 fields of administrative settings.

Would this create massive overhead with the app, cause it to be error-prone, or is this a feasible idea? Of course, contingent operations (like a checkbox that then requires a text entry) would be held until the textbox gained and lost focus.

Comments?

+1  A: 

Seems overly complicated. A well placed Save button(s) would work fine for all users, and be more usable. Not to mention it will save you(coding) and your server(bandwidth) a lot of work.

Galen
As far as the coding - it seems like it would be less coding, since I would be defining (on the server side) a function to accept the connection, get the table, field and value from the POST, then process it, as opposed to constructing an array from the POST variables (the database is legacy, so I have to do some acrobatics there), then passing it in one big bolus to the database.I guess the question is: will there be that much more coding overall? As for bandwidth - that'd be a consideration.
b. e. hollenbeck
Yes because you'll still need a save button for people that dont have javascript. Then youll need to write the javascript code. Either way youll need a save button
Galen
+2  A: 

Obviously this would lead to a lot more HTTP requests being made to save the user's data, along with a lot more updates in your database. So this approach is definitely more expensive than a single submit. Whether or not it's overly expensive depends on your server load.

To me, the big difficulty is that users have been trained to expect that forms only save data when they hit "submit". There'd be a certain amount of work you'd have to do to make it obvious to them that you're auto-saving their input. Some users might be concerned by the lack of a "save" button, and others might complain that they started editing their data, but then changed their mind, and now their partially-complete data has inexplicably overwritten their old data.

I'm inclined to view it as more trouble than it's worth. But others might weigh these things differently.

David