javascript - Get element ID on click and send them to form -
a client needs system in customers able check photos (displayed on grid) , send e-mail (via form placed below photo grid) photos' ids.
the first alternative came in mind apply onclick photos' id, have no idea how send them form.
quite easily, run onclick event id store in variable , replace form input tag value value:
var id; // contains image id $("input").val(id); or if have more input tags add id attribute them , change corespondingly selector. , can fire submit button post form data.
or more advanced yet in case more appropriate way send data ajax without need of form.
Comments
Post a Comment