This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Shadowing properties, how to access? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Shadowing properties, how to access?" Watch "Shadowing properties, how to access?" New topic
Author

Shadowing properties, how to access?

D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 471
Sorry, I have already asked but forgot a solution. I have a form with field action. How can I get actual action property of a from (not field).


Get power of your iPod with MediaChest | Minimal J2EE container is here | Light weight full J2EE stack | My blog | Co-author of "Windows programming in Turbo Pascal"
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15362
    
    6
Get
var myAction = document.formName.action;
Set
document.formName.action = "foo";

Eric
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 471
It doesn't work for me, if a form already has field named as action.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

Ah, I see what's you're doing now.

The simple answer is, of course, don't name an input element action; or onsubmit, or name, or any other identifier that is already in use as a property of the form element.

Doing so masks the form element property of the same name.

I know of no way to address the actual property of the form once you've masked it with an input element of the same name.
[ February 24, 2007: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 471
I use a certain framework which automatically generates form based on database schema and provides all data exchange. It seems it needs some improvement to care additional mapping when schema names conflicting with form reserved word properties. Any ideas what it can be? for example addin '__' to name or !! something definetly can't be allowed to database schemas to avoid new conflicts.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

The set of properties for the form element is pretty small (see here) so it shouldn't be a problem to rename any schema elements to avoid these names.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shadowing properties, how to access?
 
Similar Threads
how to set value of text field
problem in setting value of Field in action
Struts layout:select
how to get the value from the readonly field?????
Require help in submitting <form> through JavaScript function