Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Shadowing properties, how to access?

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get
var myAction = document.formName.action;
Set
document.formName.action = "foo";

Eric
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't work for me, if a form already has field named as action.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic