JSFiddle - React, Tailwind, and code Playground

by santhosh lanka

HTML

<div ng-app ng-controller="formCtrl">
<form name="myForm" ng-submit="onSubmit()">
    <input ng-model="price" name="price_field" ng-pattern="/^[a-zA-Z\s]*$/" >
    <span ng-show="myForm.price_field.$error.pattern">Not a valid number!</span>
    <input type="submit" value="submit"/>
</form>
</div>

JavaScript

function formCtrl($scope){
    $scope.onSubmit = function(){
        alert("form submitted");
    }
}