I have a page and a large form with many texareas (lot of text, I've made a cms system) and my form is kinda "heavy", I use some javascript to update it and then save/post form with php submit and $_POST variables and that bit.
I have given this javascript function a setTimeout to 3 seconds to give the form some time to update before saving, just to be safe. This halts the save function and makes everything slower of course, which is a little annoying and not so smooth.
Is this neccessary ? I really dont want my users to get half the form saved if I dont have the timeout before saving (i.e. if the machine running the page is slow).
The save/post commando is executed at the end of the update javascript function. Javascript do one line at the time at executing the code, right ?
It wont save before update is done if the save command is at the end ? or am I wrong ?
(I've done some c++ programming before and threads were executed at the same time if not using callbacks.)
Done some debugging to check this, but am I just being too scared and careful ?
Can I leave out the timeout ? Is speed an issue ?
Sorry many questions, any thoughts?
thx!