NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can I ask a DHTML question

Jose Villegas villeg2 at nyc.rr.com
Tue Oct 22 22:06:43 EDT 2002


In Explorer 5 and Netscape 6 you can actually create elements on the fly
and insert them anywhere in your document. I've done this successfully
with tables and table rows. I'm not sure if this works for all html
elements, but give it a try.

This is a way it works with tables:

Let's say I have a div tag in my html document like this:
<div id="placeHolder"></div>

With JavaScript I can create a table element like this:
var newTable = document.createElement("table");
newTable.width = "300";
newTable.style.backgroundColor = "blue";
newTable.border = 1;

I can then append the table to the html document like this:
var x = document.getElementById("placeHolder");
x.appendChild(newTable);

Of course, with tables I also have to create and append all the table
elements.

hope this helps,
Jose

----- Original Message -----
From: "Mark Jia" <markjia at yahoo.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Tuesday, October 22, 2002 2:38 PM
Subject: [nycphp-talk] Can I ask a DHTML question


>
> I got an interface project, but I never be an interface programmer, I
think a lot of people out there could know this or could give me some
hints, here is my problem:
> I have one text field and a button,  if user want to ask for another
text field, user just simply click on the button, then another text
field will be generate right after the previous text filed,  user can
generate unlimited fields, this function should work for both IE5.0+ and
Netcape4.0+.
> like this:
>                                          -------------------------    
      ----------------------------------------
>  Enter your account    :       |                         |
|click if you have more accts|
>                                          --------------------------   
       -----------------------------------------
> when user click on "click if you have more accounts", another text
filed will be generate right on the next line.
> I know it will use Javascript, also some knowledge about windows DOM
structure, I didn't find some similar website, could you give me some
hints? or give me a website using this kind of text fileds.
> sorry it is not a PHP question.
> Thank you for your help!
> Mark
>
>
> Regards
>
> Mark Jia





More information about the talk mailing list