javascript - How can I create a loop in an onClick event? -
i want write onclick
event submits form several times, iterating through selected items in multi-select field, submitting once each.
how code loop?
i'm working in ruby on rails , using remote_function()
generate javascript ajax call.
my quick answer (as i've not coded yet) create function creates post using xmlhttprequest , specific parameters single call. inside onclick() handler call function loop through selected items.
i suggest proof of concept using dummy html page , javascript , try figure out how work in ror.
also, why attempting make multiple calls browser opposed handling looping conditions in ror controller?
Comments
Post a Comment