Print Page | Close Window

Javascript Form Targetting

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=15202
Printed Date: 29 March 2026 at 12:51am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript Form Targetting
Posted By: ub3rl337ch3ch
Subject: Javascript Form Targetting
Date Posted: 24 May 2005 at 12:12am
Is there any way that I can use javascript to alter the target and action of a form, like document.form.target='this_window' and document.form.action='thepage.htm'?
 
or have i just answered my own question?



Replies:
Posted By: Gullanian
Date Posted: 24 May 2005 at 1:15am
I think you may of possibly answered your own question.  


Posted By: ub3rl337ch3ch
Date Posted: 24 May 2005 at 2:02am
lol ok...
 
I went looking again and found a list of properties, but what i found said that only form.action was read/write... is that true? or are the writers of that site full of it?


Posted By: Gullanian
Date Posted: 24 May 2005 at 2:55am
Sorry don't quite understand,

document.form.action

Should work fine as a read and write.  EG reading the value:

var myVar = document.form.action;
(possibly document.form.action.value;)

And write would be:

document.form.action = 'new.asp';

Hope this helps.


Posted By: ub3rl337ch3ch
Date Posted: 24 May 2005 at 4:12pm
i found something that suggested that while action could  be changed using document.form.action = 'thepage.asp', the target could only be read, not written.
 
Is it true that target is a read-only property as far as js is concerned, or do you still call it as document.form.target = 'New_window'?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net