after thinking about it a little more.. i'm thinking that onsubmit() may get fired again when you do form.submit() which would cause a loop.
if that is the case, then i'd say you need to set a js variable outside the scope of the function to track if the data is valid.
for example:
HTML Code:
var form_is_valid = false;
function createRequestObject() {
if (form_is_valid) {
return true;
}
// .... rest of code for this function
}
function useHttpResponse() {
...
// on successful validation, set form_is_valid and re-submit form
form_is_valid = true;
document.form1.submit();
}
i haven't actually tested this stuff.. so only try this if my first suggestion fails.