[thelist] DIV InnerHTML,JavaScript, and Forms...

Tom Dell'Aringa pixelmech at yahoo.com
Fri May 31 12:58:08 CDT 2002


Eric,

Eric,

if the form elements have an id they are for sure part of the document and should be readable. I
just tried this myself and it works in IE5.5. as:

function doIt() {
	mm = "<input type='text' id='b' value='hi'>"
	document.all.myBlock.innerHTML = mm
	alert(document.all.b.value)
}

where myBlock is my element to place the innerHTML and as you can see I placed a form field in it,
and then the alert correctly fires off the value of the form element.

If you have some code that is not working, fire it up.

Tom
--- Eric Langlitz <elanglitz at b-d-g.com> wrote:
> --
> [ Picked text/plain from multipart/alternative ]
> Hey everyone, here is a stumper (for me anyhow...).  I am working on a form,
> that contains <div> areas that are not visible to start with (ex: <div
> id=²butter²>&nbsp;</div> ).  When a user chooses the correct button, etc, a
> .js function replaces the blank area with a form field via innerHTML (ex:
>
> Function changeMe(){
> Document.all.butter.innerHTML = ³form field html here = Œstuff¹ and more
> html²
> }
>
> Now, I know that innerHTML is a bastard in Netscape, which I really don¹t
> need to address.  The problem is, the form shows up and works great, but I
> cannot capture the form elements in this <div> when I submit the form.   I
> can only guess this is because they really don¹t exist on the page...
>
> Any one have a solution or thoughts?
>
> - Thanks!
> --
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the thelist mailing list