NYCPHP Meetup

NYPHP.org

[nycphp-talk] Dynamic Textbox

Nestor Florez nestorflorez at earthlink.net
Tue Jan 18 02:14:10 EST 2005


Run javascript:  and see if it finds any errors.
Also when you enter informaton in the box, wy don't you
have a box pop up to display the values of the elements
you want to see.  It wll help you debug your code.

Nestor :-)

-----Original Message-----
From: Sajith A <sajith.ml at gmail.com>
Sent: Jan 17, 2005 11:05 PM
To: NYPHP Talk <talk at lists.nyphp.org>
Subject: [nycphp-talk] Dynamic Textbox

I'm trying to add dynamic textboxes in a form. 
The javscript function to add the textbox is this 
-----------------------------------------------------------------
function addAttribute()
{
	count++;
	divA = document.getElementById('divAttribute');
	divA.innerHTML = divA.innerHTML + ".... <input type='text'
name='attributes[]' maxlength='200' size='35'> .....";

}
-----------------------------------------------------------------
Inside the form i have a block "<div id='divAttribute'></div>" whose
contents will change when i click a button which calls the function
addAttribute();

Now the function is working fine except that in firefox, innerHTML is
not giving the value i typed into the textboxes. So each time i add a
textbox, the values i typed into the previously added textboxes are
lost. This is happening in firefox only. In ie it is working fine.
When i tried to list the elements in firefox, i found that the
dynamically added textboxes are not appearing in the list.
Yet gmail's "Attach a file" is working fine in mozilla. wondering what
they are doing...
Has anyone encountered a similar problem before? 
Any thoughts/alternatives?

---------------------------------
s�j�th
http://apilgrim.info
sajith.ml[at]gmail.com
_______________________________________________
New York PHP Talk
Supporting AMP Technology (Apache/MySQL/PHP)
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org






More information about the talk mailing list