Forum Moderators: open
I made the following function to serialize forms and add some other data to the post request..
function formSend(formName, sendData) {
sendData = sendData +"&"+ Form.serialize(formName);
//alert (sendData);
new Ajax.Request("centercontent.php", { method: 'post', postBody: sendData, onComplete: onFinish});
}
This is the form I am trying to submit (it is created somewhat dynamically with php, but I will include the clientside output (from firebug) for clarity
<form id="itemEntry">
<a href="#lowercenterAnchor">Item Name</a>
<input id="itemName" tabindex="1" size="25"/>
<br/>
Description:
<textarea id="description" tabindex="2" cols="50" rows="5">describe</textarea>
<br/>
Pack QTY:
<input id="packQty" tabindex="3" size="15"/>
Cost:
<input id="cost" tabindex="4" size="10"/>
<br/>
Web page Link:
<input id="link" tabindex="5" size="30"/>
<br/>
Keywords
<input id="keywords" tabindex="6" size="25"/>
<br/>
(Keywords will be used to search for an item, can be related to tests it used for etc. Separate by spaces
<br/>
Comments:
<textarea id="comments" tabindex="7" cols="50" rows="5">comments?</textarea>
<br/>
<input id="addItem" type="button" onclick="formSend('itemEntry','mode=6&add=yes&vendorID=9');" tabindex="8" value="Add Item!"/>
</form>
the data posted according to firebug is: mode=6&add=yes&vendorID=9&
my form data should be after the last & and is not. I use this same function other forms and it works fine. Any help would be greatly appreciated.
Thanks
Cheers.