You are here: irt.org | FAQ | JavaScript | Form | 7.2 | Q431 [ previous next ]
The following changes the forms target when a button is clicked, it should work okay in Netscape Navigator and Internet Explorer 4:
<FORM TARGET="_top"> <INPUT TYPE="BUTTON" onClick="alert(this.form.target)" VALUE="Show Target"> <INPUT TYPE="BUTTON" onClick="this.form.target = 'awindow'" VALUE="Change Target"> </FORM>
If you need it to work in Internet Explorer 3 you'll need to use JavaScript to collect the forms name-value pairs and then open up a popup window and then pass that across. Take a look at the article Passing data from one form to another.