It does'nt work, if i submit a form from another frame, it submits the form but does'nt envoke the onSubmit call on that page (I want it to call a javascript function on that page when it submits). anyone know of a workaround?
The onsubmit event handler is part of the frame that's being submitted, not a page. You can call functions in a parent frame or page using parent.functionname() (if the function is in the parent) in the onsubmit event for the frame.
If you were to show your relevant code (not the whole pages of HTML and script), it would help immensely in answering your question.
onsubmit events do not get fired when calling a form's submit method programatically. This is normal.
Thus, if you are calling the submit method to submit the form, expect it never to be called. Instead, you will have to call "the function" (i.e. whatever is in the onsubmit handler) directly.
You mentioned frames in your original post, though. Maybe you should show the relevant code (not the whole pages) so we can see what you're referring to.
therefore the script is exected once the value of the input box has been. The first statement successfully assigns the value of the text box in the target form/page. On tarhet oage there also exists a method mapLoad() which is defined in the header of the page.
returns me an error saying that parent.map.document.mapForm.mode.value is null or not an object, if that was the case then by the above code should it not follow on to set the value of newMode rather than denerate an error?
This says that the parent to the frame with this function has a frame called map that has a form called mapForm spelled EXACTLY like that, and that form has an element named mode spelled EXACTLY like that. The error message says that doesn't exist.
Since you're reluctant to show the relevant code, that's about all I can tell you to help you.
the error does'nt always come up, sometimes the frame I'm trying to access the value mode from fails to load before the test, other times it works fine.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.