View Single Post
Old 12-08-2006, 07:17 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
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.
__________________
Mike
sde is offline   Reply With Quote