|
|
Handling Windows and Frames Across Browsers Handling subwindows and framesHandling frames is somewhat different than handling a single document window because you need to specify which frame you want to use. Just like on forms, you can name the frames and reference them by that name instead of by the number. On a simple document split in two vertical frames, referencing these frames would be something like this:
You can refer to it from another frame such as All of this seems very easy, but try to reference a specific frame from a subwindow created on the left frame of the document above. From this subwindow, you want to open a different page on then
You can view an example here (or you can download a Zip archive of these files). Common compatibility issuesSome of the most common problems I experienced while developing applications that make use of JavaScript were compatibility issues with using JavaScript functions to validate forms in a "wizard" type utility. Users would go from step 1 to step 8 by filling up forms and on each step a custom function would check the values for any problems, and if everything was correct, submit the form to the next step. This entailed using buttons on the HTML forms and calling the JavaScript functions to validate the form. If the form contents were not valid, the script would show an error message and ask the user to fix the problematic field.
So the form validation code is something like that, but the real implementation is up to you. You would need an HTML button like this for the code to work:
This is the only piece of code that works flawlessly under all versions of Microsoft Internet Explorer, Netscape Navigator, and Mozilla. I tried making the form validation triggered by a Most of the time, advanced JavaScript functions are custom-made, so it's a good idea have several copies of Netscape and IE to test your scripts. Nothing is more important than unit-testing your scripts in a systematic way. It is not easy or fun, but you will surely have reliable code. I hope this article could help on some of the issues relating to JavaScript handling to multiple windows and frames and also some form validation tips. Cheers! Joao Prado Maia is a web developer living in Houston with more than four years of experience developing web-based applications and loves learning new technologies and programming languages. Return to the JavaScript and CSS DevCenter. Showing messages 1 through 2 of 2.
|
|
|
|
|
||||||||
I tried a workaround, that is in the originating window i did a document.write on the new window and created a hidden tag to pass the value. But i was not able to do that.
Please guide with a suggestion.
Thanks,
Vikram