[thelist] JS: How to differentiate two properties with same name?

niklaus.haldimann at xmedia.ch niklaus.haldimann at xmedia.ch
Fri Jul 5 06:35:01 CDT 2002


--
[ Picked text/plain from multipart/alternative ]
hi list

i have to access the action property of a form object. but there is a hidden
field called "action" in that form. so when i do "this.form.action" i don't
get the action property but the hidden field object. can i somehow access
the action property anyway?

to illustrate the problem, this is about how the code looks like:

<form method="post" action="something.php">
<input type="hidden" name="action" value="addcomment" />
<input type="button" value="waste log"
onClick="this.form.action.='http://someotherserver.com/somethingelse.pl');th
is.form.submit()"/>
</form>

i know, in general i shouldn't change the action with javascript but check
the for the name of a sumit button on the server side. but in this case it's
just not possible (the url i redirect to is on a different server, and this
code is supposed to work on several different setups where i cannot
influence the script "something.php").

cheers,
nik



More information about the thelist mailing list