473,385 Members | 1,569 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,385 software developers and data experts.

DHTML / form elements

Hi there,

I've started using DHTML to dynamicly build a part of my page, I now
need to add a form element (select and textarea), I tryed several
things but it is not working.

if I use the following to create a text field, how can I display it in
the table / form?
(I tried something with: appendChild(input) but that would not work,
perhaps I'm doing it wrong.

var input = document.createElement('input');
input.type = 'text';
input.id = 'inputName';
input.name = 'inputName';

This is my first post here, I hope this is the right place to post my
question.

Regards,

Arno

Nov 10 '05 #1
2 1244
Q1tum wrote:
Hi there,

I've started using DHTML to dynamicly build a part of my page, I now
need to add a form element (select and textarea), I tryed several
things but it is not working.

if I use the following to create a text field, how can I display it in
the table / form?
(I tried something with: appendChild(input) but that would not work,
perhaps I'm doing it wrong.

referenceToElement.appendChild(input)
for example:
document.getElementById("elementIDHere").appendChi ld(input)
document.forms["formNameHere"].appendChild(input)

I dont like the use of "input" as a name for a variable, although it
should work.
Mick
var input = document.createElement('input');
input.type = 'text';
input.id = 'inputName';
input.name = 'inputName';

This is my first post here, I hope this is the right place to post my
question.

Regards,

Arno

Nov 10 '05 #2
Yes thanks, it is working now :)

Nov 10 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Henning Heil | last post by:
hello all! I have a little problem with a DHTML feature which works fine with most browsers but not with NS4. an example can be found here:...
0
by: mscir | last post by:
Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <x46dnXQO6_TFqErfRVn-jw@pghconnect.com> Lines: 24 NNTP-Posting-Host: 67.136.138.220 X-Trace:...
6
by: NotGiven | last post by:
I want to learn moer of what I saw in a recent example. They create a page that created new fields/element. It's not like they were hidden and they displayed them, they were not there, then the...
12
by: ATS | last post by:
I need to hide/reveal parts of a web page using javascript. I think I can do with using the <span> tag, but I've been away from it for a while and don't remember. Any pointers, examples?
18
by: Andromeda | last post by:
I've been trying to add a tree menu to my website with some luck (more or less). I came across a script on simplythebest.net, but I seem to be having a problem with it... and since they have no...
0
by: manju | last post by:
Hi, I use DHTML browser as my main application window and I create elements like <p>, <table>, <img> etc dynamically using MSHTML C++ interfaces like IHTMLDocument2::createElement...
4
by: Steve | last post by:
hi all, i'm using DHTML to generate a dynamic table with adding removing and sorting rows the thing is after a row has been added at a position that i specify, if i try to delete it i get this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.