Back to the Web Developer's Journal Main Page
internet.com
side nav bar

The JavaScript Weenie has heard this question so often that she's kindly put together a brief page of links to articles and scripts that should help.
Javascript Articles:

HOW DID THEY DO THAT???

Find out in:
Amazing HTML



Site Map

Jobs at webdeveloper.com


Check out our Web-based
Discussion Groups:

Check out and join our email-based Mailing Lists for Web developers.


Developer Channel
FlashKit
Jobs.webdeveloper
JavaScript.com
JavaScriptSource
JustSMIL
ScriptSearch
Streaming Media World
WebDeveloper.com
WebReference
XMLFiles
WDVL
Discussion Groups Book Reviews Software Reviews Download Web Tools

There Are Many Easier Things To Do In Life

How do I use JavaScript to Pass Values from one Field, Frame or Window to Another?

by Paige Turner

As JavaScript Weenie, I've heard this question so often that I've decided to put together a page of links to articles and scripts that should help.
October 17, 2000

Here's quick introduction.

The main issue with transferring values from one place to another is making the correct reference to the value you want to transfer. If you have just one form on a page, with one field, and you want to extract an entered value and use it in, say, an alert box, that's relatively easy.

If you want to extract a value from a form and place it in another form, it gets more complicated because you have to be careful how you name your forms. The references to the values get longer and more complicated.

Transferring between frames again requires care with names.

If you want to transfer values between windows, you're asking for trouble. The reason is that you're entering into Document Object Model (DOM) territory, and the Netscape and Explorer DOMs are quite different. It's not too hard to make the transfer work in just one type of browser, but doing it for both main browsers requires many lines of cross-browser JavaScript. In fact the cross-browser version is so difficult that it's rarely done - we've found no reference to it on the Internet. You'll almost certainly have to parse the browser and supply different code for the two main types.

All in all, transferring values using JavaScript is a tricky business and you'll need a decent knowledge of JavaScript to adapt the examples below to your specific requirements.

Tutorials

Passing parameters and returning values.
http://www.webdevelopersjournal.com/articles/jsintro3/js_begin3.html

Writing across windows in IE5 (begins half way down the page).
http://javascriptweenie.com/articles/dynamic_doc_windows.html

Using JavaScript and forms. About 10% of the way down the page is a short section entitled: Getting a Value from a Form Object.
http://www.webreference.com/content/jssource/chap16.html

Values from form objects. There's a script half way down the page.
http://www.javaworld.com/javaworld/jw-06-1996/jw-06-javascript.html

Using JavaScript to Write JavaScript (actually it's more about JavaScript within multiple frames)
http://www.webtechniques.com/archives/1997/09/junk/

Scripts

Pass form values from one page to the next.
http://javascript.internet.com/forms/passing-values-source.html

Pass Textbox (in frames).
http://javascript.internet.com/forms/pass-textbox-frames.html

Pass Menu (in frames).
http://javascript.internet.com/forms/pass-menu-frames.html

Mousover in one frame changing an image in another frame.
http://idm.internet.com/ix/msg/22464.html


At the following irt.org site you can find further scripts:
http://www.developer.irt.org/script/form.htm#10

Examples of their scripts include

Copying multiple options from one options list to another.
http://www.developer.irt.org/script/218.htm

Copy letters from one form field to another,
http://www.developer.irt.org/script/420.htm

Set the value of a form field when a check box is selected.
http://www.developer.irt.org/script/933.htm

Pass values from one frame to another in a single frameset.
http://developer.irt.org/script/834.htm



Back to the Web Developer's Journal
Contact WDJ   •    Suits!   •    Propheads!   •    Ponytails!
Discuss   •    Subscribe   •    Search


internet.com

IT | Developer | Internet News | Small Business | Personal Technology | International | Search internet.com | Advertise | Corporate Info
Newsletters | Tech Jobs | E-mail Offers

internet.commerce
Be a Commerce Partner                                
  

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers