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:

<form action="#">
    <input type="button" name="btn" id="btn" value="Make a Textfield" onclick="textfield(this);" />

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?


10 Years
Discussion Span
Last Post by ~s.o.s~
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.