I've got a form which posts its results using "get" method. I was wondering how I could add some additional values to these results before they are submitted.
What I did so far is overload the submit function so I could concat my additional string which I wish to pass along with the form results to the destination url.
On regular submit the destination url gets the results as follows:
..dest url?txtName=e&txtAge=r&gender=mail&select=1
What I am attempting to do is append another string to these results
..dest url?txtName=e&txtAge=r&gender=mail&select=1|myStringResult
I've overloaded the submit
function overLoadSubmit()
{
window.addEventListener('submit', newSubmit, true);
HTMLFormElement.prototype._submit = HTMLFormElement.prototype.submit;
HTMLFormElement.prototype.submit = newSubmit;
}
The original submit is called after newSubmit(), and that's where I would like to append my string.
function newSubmit()
{
var myForm = document.forms[0];
var s = "|myStringResult";
// here is where i would like to append s ,
// but i can't figure out how to reference the form results
// or how to add it to the original submit
}
I've also tried adding an hidden input control
<input type="hidden" id="_body" value="getValues();"/>
since myResultString is really long and is in fact an entire html document
function getValues()
{
var _doc = document.childNodes[1].innerHTML;
return '|' + _doc;
}
This doesn't seem to work.