Validation error not showing in right place

52 Views Asked by At

I have appended a select box dynamically inside a td tag using jquery and assigned that class required-entry but when i submit form validation not showing on the right place. this is my appended code.

var addrow = '<tr class="item"><td><select onchange="getPrice(this)" id="selectbox-'+counter+'" name="pid[]" customerid="'+customer+'" class="required-entry required-entry select">';
        addrow +='<option value="">select product</option>';
        for (i = 0; i < valueArray.length; i++) {
           addrow +='<option value="'+valueArray[i]+'">'+textArray[i]+'</option>';
         }
        addrow +='</select></td><td style="width:50px"><input type="number" id="qty-box-'+counter+'" class="qty-box" max="1000" min="1" value="1" name="itemqty[]" onchange="qtyUpdate(this)" customerid="'+customer+'"></td><td><p style="font-weight:bold" id="price-'+counter+'">&nbsp;</p><br></td><td><p style="font-weight:bold" id="ext-'+counter+'">&nbsp;</p><br></td><td class="center"><input id ="delsku-'+counter+'" type="checkbox" value="" name="deletesku[]"/></td></tr>';

        jQuery("#items-table").append(addrow);

enter image description here

add errors are showing together i want error just below of selectbox

0

There are 0 best solutions below