How build a list dynamically and pass/save user selected values from an HTML form to server?
I think in this case I need to开发者_如何学运维 write a client side script that onpageload/onchange gets options from server & builds a list dynamically. & stores new options to server via some JavaScript script. I will prefer to save user input in a file on server. I will be very thankful for any help.
Here is the stack we use for our web app and that works more or less the way you describe:
- the user load an HTML page
- the page make an ajax call and get the options as a JSON(either it exists already in the database, or a new option set is generated)
- the json is rendered using a JS templating engine (PURE in our case)
- the user change something
- the same JSON is modified and sent by a POST to the server
- the server read that JSON and store it in the database(you would write the data to your file). And then go back to the step 4, to wait for another user change.
精彩评论