473,396 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to access the attribute of object in a function

77
hello all,,

i have this function of javascript

Expand|Select|Wrap|Line Numbers
  1. function setObj() {
  2.  
  3. var form = document.forms[0];        
  4. var td = document.createElement('td');
  5. var theInputHpp = document.createElement('input');
  6. theInputHpp.setAttribute('type', 'text');
  7. theInputHpp.setAttribute('name', 'items['+form.podcnourut.value+'][podnhpp]'); 
  8. theInputHpp.setAttribute('size', '20');
  9. theInputHpp.setAttribute('value', form.podnhpp.value);
  10. theInputHpp.setAttribute('align', 'right');
  11. theInputHpp.setAttribute('readOnly','true');
  12. theInputHpp.style.textAlign="right";
  13. td.appendChild(theInputHpp);
  14. row.appendChild(td);
  15.  
  16. var td = document.createElement('td');
  17. var theInputDisc = document.createElement('input');
  18. theInputDisc.setAttribute('type', 'text');
  19. theInputDisc.setAttribute('name', 'items['+form.podcnourut.value+'][podndisc]');
  20. theInputDisc.setAttribute('size', '5');        
  21. theInputDisc.setAttribute('value',form.podndisc.value);
  22. theInputDisc.setAttribute('readOnly','true');
  23. theInputDisc.style.textAlign="right";            
  24. td.appendChild(theInputDisc);
  25. row.appendChild(td);
  26. }
i want to access / get the attribute of podnhpp object (
Expand|Select|Wrap|Line Numbers
  1. theInputHpp.setAttribute('name', 'items['+form.podcnourut.value+'][podnhpp]'); 
) in another function, can u tell me how??

thanks..

regards,
maminx
Dec 17 '08 #1
2 958
acoder
16,027 Expert Mod 8TB
I have split your post into its own thread. Please do not hijack others' threads.

Moderator.
Dec 17 '08 #2
acoder
16,027 Expert Mod 8TB
Try
Expand|Select|Wrap|Line Numbers
  1. theInputHpp.setAttribute('name', items[form.podcnourut.value][podnhpp]); 
Dec 17 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ruud de Jong | last post by:
I have the situation where I need to construct the name of a static method, and then retrieve the corresponding function from a class object. I thought I could just use __getattribute__ for this...
0
by: Michele Simionato | last post by:
Here is a hack to implement attribute access (say for a Web framework) the way I always wanted it to be. I say "hack" since it uses sys._getframe and it sets the locals of a class, which is not...
166
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
8
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
2
by: enrio | last post by:
I need to process the source code associated with the forms outside access, and import the changes back to Access. I find that I can export the source code of a form, but when I subsequently...
9
by: | last post by:
Hi All, I have allready tried to ask a similar question , but got no answer until now. In the meantime, I found, that I cannot understand some thread-settings for the Main() function . If I use...
4
by: Arjen | last post by:
Hi, I have a class with some attributes. For example class person with name as attribute. I have add multiple persons in an arraylist. Now I need a function to get/find a person by the name...
6
by: Adam Donahue | last post by:
As an exercise I'm attempting to write a metaclass that causes an exception to be thrown whenever a user tries to access 'attributes' (in the traditional sense) via a direct reference. Consider:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.