-2

I have a one text box search, and one button,when i add the text and click button, related data will be getting but when i click another search.that is taking same id,previous id not clearing. how to clear that id

    <div class="col-lg-4 col-sm-4 col-xs-12">


    <i class="glyphicon glyphicon-search"></i>

    <div class="form-group">

        <input type="text" class="form-control" id="isbncollegeid" data-ng-model="isbncollege" placeholder=" Search By college ISBN" name="isbncollegeid">
    </div>

</div>
<div class="col-sm-4">
    <br />
    <div class="form-group">
        <input type="hidden" id="bookcollgeIsbn" name="bookcollgeIsbn" />
        <button type="button" class="btn btn-sky" id="IsbntcolDetails" data-ng-disabled="LibraryIsbnForm.$invalid" data-ng-click="DetailscolByISBN()">Get Details<i class="fa fa-exclamation"></i>
        </button>
        <button type="button" class="btn btn-sky" id="clear" data-ng-click="ClearISbnCollege()">Clear<i class="fa fa-exclamation"></i>
        </button>

    </div>
</div>
LellisMoon
  • 4,810
  • 2
  • 12
  • 24
raju
  • 1
  • 3

2 Answers2

0

You can use below line of code after getting results in javascript:

document.getElementById('elementid').value = "";

in Jquery:

$('#elementid').val("");
abpatil
  • 916
  • 16
  • 20
0

In your ClearISbnCollege just make isbncollege model empty

$scope.ClearISbnCollege = function() {
    $scope.isbncollege = "";
}

When you will click the Clear button, input will be emptied.

iamandrewluca
  • 3,411
  • 1
  • 31
  • 38