Click here to Skip to main content
14,218,748 members
Rate this:
Please Sign up or sign in to vote.
Hi friend ,
here is a popupform and its have a row with two drop down list ,
i clone this row successfully and when i click on new clone row update button i want check this e.s its have any selected value in dropdown list or it is nullORempty

What I have tried:

$(document).on('click', '.u', function () {
    var $Cont_sr = $(this).closest("tr").find('.new_cont').val().trim();
    var m_c11 = $(this).closest("tr").find('.cnttxt').val().trim();
    var m_c21 = $(this).closest("tr").find('.cntnum').val().trim();
    var m_c31 = m_c11 + m_c21;
    $(this).closest("tr").find('.contval1').append(m_c31);
    $(this).closest("tr").find('.contval1').val(m_c31);
    var NewcontType = $(this).closest("tr").find('.ContTp1').val().trim();
    alert(NewcontType);
    var isAllValid = true;

    if ($('.ContTp1').val() == "") {
        $(this).closest("tr").find('span.orderItemsError1').text("Plese Select Container Type From DropDown List ");
        isAllValid = false;
        $('.ContTp1',this).siblings('span.orderItemsError1').css('visibility', 'visible');
// hire i need show span error 
    }
    else {
        $('.ContTp1', this).siblings('span.orderItemsError1').css('visibility', 'hidden');
    }
    if (isAllValid) {
        alert("ok");
    }
else{
     alert("not ok");

});


popup form html (clone row )

<div id="contItems" class="newr1">
			<table class="table table-responsive table-hover table-bordered" id="contdetailsItems"><tbody></tbody></table>
			
			<span id="orderItemsError" class="orderItemsError1" style="color:red"></span>
		</div>
Posted
Updated 27-Apr-19 19:25pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100