Hey folks,
Really could use some advice on a function. The code works fine in
creating the element, however, the associated function to the
dynamically added element doesn't run. If you can suggest a way to fix
this or a better way to code this function, I'd really be
appreciative. I've been struggling with all different things. I even
tried defining a parentid as <input id="parentid" name="parentid"
type="hidden"an d appending a child. It didn't work.
Any thoughts?
thanks,
-m
function addFormField1(a ,b) {
var id = document.getEle mentById("id"). value;
$("#div" + a + "").append( "<p id='row" + id + "'><label for='txt" +
id + "' < input type='text' size='43' onkeyup='alert( '" +
a + "" + id + "');' name='" + a + "[]' id='" + a + "" + id +
"'> <a href='#' onClick='remove FormField1(\"#r ow" + id + "\");
return false;'><img src='images/01_03.gif' border='0' ></a><p>");
$('#row' + id).highlightFa de({speed:1000} );
//document.getEle mentById("paren tid").appendChi ld("'"+ a + "" + id
+"'");
id = (id - 1) + 2;
document.getEle mentById("id"). value = id;
}
Really could use some advice on a function. The code works fine in
creating the element, however, the associated function to the
dynamically added element doesn't run. If you can suggest a way to fix
this or a better way to code this function, I'd really be
appreciative. I've been struggling with all different things. I even
tried defining a parentid as <input id="parentid" name="parentid"
type="hidden"an d appending a child. It didn't work.
Any thoughts?
thanks,
-m
function addFormField1(a ,b) {
var id = document.getEle mentById("id"). value;
$("#div" + a + "").append( "<p id='row" + id + "'><label for='txt" +
id + "' < input type='text' size='43' onkeyup='alert( '" +
a + "" + id + "');' name='" + a + "[]' id='" + a + "" + id +
"'> <a href='#' onClick='remove FormField1(\"#r ow" + id + "\");
return false;'><img src='images/01_03.gif' border='0' ></a><p>");
$('#row' + id).highlightFa de({speed:1000} );
//document.getEle mentById("paren tid").appendChi ld("'"+ a + "" + id
+"'");
id = (id - 1) + 2;
document.getEle mentById("id"). value = id;
}
Comment