Belal Othman Belal Othman - 1 year ago 59
AngularJS Question

angularjs: I need reset form without showing required fields with red color

when save my form (user)
after that I need to reset it to save new user
If I reset just like that
user = {};
and try to save new user
all the mandatory fields are appear with red color

how can I reset my form to avoid the red color

Answer Source

you can reset it like below:

$scope.resetForm =  function() {
    $scope.user= {};

call this function from your save function success...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download