In the past I have always used a hidden area, and click on the submit button on the event I Use the custom code) in a hidden form field, and parse it on the server-side using custom code.
It has always been felt like a hack and I was wondering if there is a modern approach, I want to find the most common approach, but if tooling means, then I am using JQuery on the client And Ruby / Sinatra on the server Maybe the list is changed to a JSON object and then consumed by the server?
If you want a comma approved value
var value = $ .map ($ ('ol li'), function (e, i) {return $ (e). Html ();}); $ ('Form') .andend ('& lt; input type = "hidden" name = "field" value = "' + value .joined (',') + '" / "gt;');
or you can put it as an array
var inputs = $ .map ($ ('ol li'), function (e, i) {Return '& lt; input name = "field []" value = "' + $ (e) .html () + '" / & gt;';}); $ ('form'). Attachments (inputs. Join (""));
Comments
Post a Comment