form elements created with jquery dont .post
-
$("input").blur(function(){
$.post("/designyourown/scripts/post.php", { id: $(this).attr('id'), value: $(this).attr('value') } );
$('img#preview').attr('src','preview.php' + '?' + Math.random());
});
the above code works how it is supposed to with elements hard coded into the page but if i add more elements with this code
-
var count = 2;
$(document).ready(function(){
$('#addline').click(function(){
count += 1;
// $('#addlinebreak').before(
// '<strong>Link #' + count + '</strong><br />'
// + '<input id="field_' + count + '" name="fields[]' + '" type="text" /><br />' );
$('#addlinebreak').before(
'<hr>\n'
+'<table border="0" cellspacing="0" cellpadding="5"><tr><td>\n'
+'Text:\n'
+'<input name="text_'+count+'" type="text" id="text_'+count+'" size="100" />\n'
+'</td></tr><tr><td>\n'
+'Size:\n'
+'<input name="size_'+count+'" type="text" id="size_'+count+'" size="10" maxlength="3" />\n'
+'Colour:\n'
+'<input name="color_'+count+'" type="text" id="color_'+count+'" size="10" maxlength="9" onclick="startColorPicker(this)" ondblclick="hideColorPicker(this)" />\n'
+'Horizontal Placement:\n'
+'<input name="h_'+count+'" type="text" id="h_'+count+'" size="10" maxlength="3" />\n'
+'Vertical Placement:\n'
+'<input name="v_'+count+'" type="text" id="v_'+count+'" size="10" maxlength="3" />\n'
+'</td></tr></table>\n');
});
});
element added wont post to the php page only the hard coded elements do
if you would like to see a live working version let me and ill try and set it up
looking forward to any help