I have several hidden input fields used to hold coordinates calculated by javascript. The purpose of these fields is to pass the coordinates when the form is submitted. I am using an AJAX request through MooTools. Is there a simple way to eliminate the hidden input fields and append them to the $_POST data being sent through the form?
I have several hidden input fields used to hold coordinates calculated by javascript. The
Share
yes. if very much depends on the way your form data is defined / how it is sent. for example:
new Request({ data: $("formid") }).send();will serialise the form and send all form fields through. what you can do is move the hidden fields into the form before submit so it will include them also (via$("formid").adopt(el1, el2, ... eln);where els are your hiddens – or a collection you have done like$$("input[type=hidden]").if you compose the data object manually then just add them to it with a key, its just a hash table of key->value pairs.