Problem: I have 2 frames, each with a form. One frame is for navigation, the other is for 'doing stuff'
I want to click something in Frame A (Navigation frame)
and get the following behavior:
1) Submit the form in Frame B (to save changes)
2) Change the location of Frame B after saving changes (Navigate)
3) Frame A should not submit/reload
So far, I can accomplish either of the above goals (1 or 2), but I can't save changes AND navigate in the same act. I can get one or the other to work but I don't understand why.
Frame A (Navigation) uses code like this:
<a href="" onclick="return rowClicked(stuff)"> Navigate to Something </a>
Javascript for rowClicked:
top.frameB.document.getElementByID("frame_b_form_id").submit();
top.frameB.location="new location, so we can navigate";
return false; // Keeps frame A (Navigation) from reloading
My problem: If I don't change the location, my form in frame b submits and everything works perfectly. But I want to navigate! If I add the top.frameB.location javascript, the navigation works, but the form in the other frame doesn't get submitted!
I'm sure there's something simple I'm missing!
EDIT: This problem is in the latest Chrome and firefox browser versions ... This code seems to work as desired in IE 11, IE 8, FF 3.03
Last EDIT: I never figured out how to do this consistently across browsers. Fortunately, I realized that there was a better way to accomplish what I wanted. The page was generated by mod_perl code, so 'submitting' the page caused not only the data saving, but also page re-generation (of the page the user was already on). Navigating after that meant the server wasted time generating the page the user was navigating away from, on form submission. The real fix was in my perl code so that a form submission triggered navigation ... I used javascript to add hidden inputs that were included with the form - the hidden inputs tell the server that after saving, generate a different page (ie navigate) and return that, instead of re-generating the page the user just visited & saved.