By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,843 Members | 2,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,843 IT Pros & Developers. It's quick & easy.

combo javascipt and html question

P: n/a
sorry if this is the wrong newsgroup but not sure which html group it would
be if really more a html question
i'm trying to figure a way to enter a value for my form action target right
on the webpage
like this,
<FORM method="Post" action="perl4.pl".........
i've tried setting a javascript variable to a value entered in a form
textfield, and using that variable, eg. action=variableName,
action=""variableName"", etc
but can't seem to find anything that works
i'm testing various scripts and its a hassle to have to keep editing my
webpage and resaving it each time i have new script name
and am thinking this would have other testing applications if it can work
for other page parameters besides form/action
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
hi,

Once a variable have the value you want, you can modify the form's action
property as:

<script>
document.yourform.action = YourVariable
</script>

<form name="yourform">
</form>

hope that hints,

Regards,
Elias
"bbxrider" <bx******@comcast.net> wrote in message
news:LvCyb.373173$HS4.3109453@attbi_s01...
sorry if this is the wrong newsgroup but not sure which html group it would be if really more a html question
i'm trying to figure a way to enter a value for my form action target right on the webpage
like this,
<FORM method="Post" action="perl4.pl".........
i've tried setting a javascript variable to a value entered in a form
textfield, and using that variable, eg. action=variableName,
action=""variableName"", etc
but can't seem to find anything that works
i'm testing various scripts and its a hassle to have to keep editing my
webpage and resaving it each time i have new script name
and am thinking this would have other testing applications if it can work
for other page parameters besides form/action

Jul 20 '05 #2

P: n/a
VK
document.forms('yourFormName').action = yourURL;
Jul 20 '05 #3

P: n/a
"VK" <sc**********@yahoo.com> wrote in
news:3f***********************@news.freenet.de:
document.forms('yourFormName').action = yourURL;


document.forms['yourFormName'].action = yourURL;
Jul 20 '05 #4

P: n/a
thanks for all the help
i guess there are a few ways to do it
i ended up calling a function, setAction()

return setAction(this.form)

function setAction(f) {
f.action=f.elements[n].value;
return;
}
still strugglling with this.form vs document.forms

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn*******************************@130.133.1.4 ...
"VK" <sc**********@yahoo.com> wrote in
news:3f***********************@news.freenet.de:
document.forms('yourFormName').action = yourURL;


document.forms['yourFormName'].action = yourURL;

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.