Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, In my code I have added the text control when I click on the "+" button.
but the same row is not deleting when I click on the "-" button. .
This is my coding for adding and deleting the dynamic controls..
Here adding is working fine...but deleting is not working..
would you please help me to delete the particular row which I added....

C#
function  OnMpBtnPlus2Click()
       {

            var Parent1Name = $("#txtDPloicyName1").val();
            var Parent1Age = $("#txtDPloicyAge1").val();

            if (Parent1Name == "" || Parent1Name == "Parent Name" || Parent1Name == null || Parent1Age == "" || Parent1Age == null || Parent1Age == "Parent Age") {
                alert("Please enter details");
                return false;
            }
            if (!isNaN(Parent1Name)) {

                $("#lblDError1").text("Please Don't enter Numbers for Name");
                return false;

            }
            else {
                $("#lblDError1").text("");
            }
            if (isNaN(Parent1Age)) {
                $("#lblDError1").text("Please  enter Numbers for Age");
                return false;
            }
            else {
                $("#lblDError1").text("");
            }

            var result_style = document.getElementById('DParent1').style;
            result_style.display = 'table-row';
        }
        function  OnMpBtnMinus2Click()

        {

            var result_style = document.getElementById('DParent1').style;
            result_style.display = 'none';
        }
Posted
Comments
What have you tried for delete click and where is the exact issue?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900