•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,516 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,817 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1015 | Replies: 1
![]() |
I have a page on which I want users to be able to create web objects on the same page with the push of a button. For example, to create a new draggable textfield object, a user would click on this button:
I'm not sure if that part is correct.
Below is the code for the function I came up with. However, it doesn't produce a new textfield. (Note the draggable class makes the object draggable - this part works if I create the textfield object manually).
What would the function be for the button to produce textfields?
Thanks!
<form action="#">
<input type="button" name="btn" id="btn" value="Make a Textfield" onclick="textfield(this);" />
</form>I'm not sure if that part is correct.
Below is the code for the function I came up with. However, it doesn't produce a new textfield. (Note the draggable class makes the object draggable - this part works if I create the textfield object manually).
function newtextfield() {
newElement.type = "button";
newElement.id = "button";
newElement.name = "button";
newElement.class = "draggable";
}
var newtextfield = next();What would the function be for the button to produce textfields?
Thanks!
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Starting Python (Python)
- Creating a popup menu on mouse over (JavaScript / DHTML / AJAX)
- Problem with timer (urgent) (Visual Basic 4 / 5 / 6)
- Multiple definition of fcn error (C)
- I want to learn - How to create and use objects. (C#)
- Write to a file in C++ (C++)
- Object-Oriented Programming (C++)
- Pointers (C++)
- error C2447: missing function header (old-style formal list?), what does this mean?! (C++)
- Classes (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: very Urgent
- Next Thread: javascript - object required error



Linear Mode