I have an RMA form in which I can add fields dynamically, but I have problems with event handling (e.g. click, change).
I am adding fields with .appendTo("#container");and increasing the NAME parameter with a counter, so that when the user clicks "Submit" I will get "Category1: blah" "Category2: blah blah" "Category 3: something_else ', etc.
The problem is that I add more fields (for example, a drop-down list) dynamically, events do not follow. I have 3 drop downs [category] [subcategory] [model]. When I choose a category:
jQuery('#cat').bind("change", function()
{
jQuery('#subcat').empty();
jQuery('#subcat').attr('disabled', 'disabled');
jQuery('#model').empty();
jQuery('#model').attr('disabled', 'disabled');
LoadSeries(jQuery(this).val());
});
jQuery('#cat'+counter).bind("change", function() { ..., , , [] .
.live, , / (cat2, cat3, cat4, cat5...)
? (LoadSeries2, LoadSeries3 ..) ?
.
EDIT: HTML- [category] [subcategory] [model]. , , .
newTextBoxDiv.after().html('
<div class="item'+counter+'"><br/>
<table width="820" border=1 cellspacing="0" cellpadding="0" align="center" style="border: 1px; border-color: #000;">
<tr>
<td>
<div align="center" style="font-size: 14px;">
<input type="radio" class="radioBtn'+counter+'" name="Return_Exchange'+counter+'" value="Return" selected="selected">Return
<input type="radio" class="radioBtn'+counter+'" name="Return_Exchange'+counter+'" value="Exchange">Exchange</div>
...