Hi everyone.
I'm unable to correctly create DOM elements using jQuery (1.3.2):
var ev_t;
$("#add-event").click(function() {
ev_t = $("<form>", { action : "someURL" }).hide().appendTo(document.body);
var fields = $("<div>").appendTo(ev_t);
fields.load("someURL", function() {
$("<input>", { type: "submit", value: "Add" }).appendTo(ev_t);
ev_t.dialog();
});
ev_t.submit(function() {
// form submission ...
return false;
});
return false;
});
The and elements are inserted but none of the attributes (form action and input type and value) are set. What am I doing wrong?