JSFiddle - React, Tailwind, and code Playground

by Prajeesh_PR

HTML

<div ng-app ng-controller="formCtrl">
<form name="myForm" ng-submit="onSubmit()">
    <input type="text" ng-model="price" ng-trim="false" id="dd" name="price_field" ng-pattern="^[a-zA-Z0-9]+$" required>
    <span ng-show="myForm.dd.$valid">Not a valid number!</span>
    <input type="submit" value="submit"/>
</form>
</div>

JavaScript

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