Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Objective:

...

Problem

...

Delete To delete all the rows that have been added in to the Form Grid when a field value is changed.

...

Code:

...

Code Block
langjavascript
<script>
$(document).ready(function(){
    var selectField = "field1";
    var formGrid = "field2";

    //when select box value is changed
    $("[name="+selectField+"]:enabled").change(function(){
        //remove all data from form grid
        $("[name="+formGrid+"]").find("table tr.grid-row").remove();
    });
});
</script>