Input validation with Angularjs on IE8

I have a form (created using a div) that is displayed when I select an option using the dropdown menu. I am using ng-options for the dropdown. My problem is I need to support IE8. I know IE8 doesn't support HTML5 and I can't use 'required' tag

. So I am trying to use the parameter"ng-required"

for form validation, but it doesn't work. I looked at the jquery validator, but I have a lot of forms and each has different criteria. For example, I have a form that requires a State / Country field in an input field that is required for a specific variation. However, the same field is optional with another option. For me, writing a validation for each one is not the right approach as I am trying to use angularjs. Please help. For example, one of the fields:

<div style="float:left; width:290px;margin-bottom: 8px;">
  <div style="float:left; margin-right:8px; width: 113px; text-align: right;"> (*)Document Number: </div>
  <div style="float:left; margin-right:8px;width: 160px;">
  <input type="text" ng-model="customerData.docNmbr" placeholder=" Document Number" class="ng-pristine ng-valid" ng-required> </div>
</div>

      

and my submit button:

<button type="submit" id="submitButton" ng-disabled="userForm.$invalid" class="btn btn-primary">Register</button>

      

+3


source to share


1 answer


What you need to do is use another library like modernizr . The main purpose of this library is to standardize some old browser like IE8 with some new HTML5 features. If you want to know more about it, this is a good article:



http://www.adobe.com/devnet/dreamweaver/articles/using-modernizr.html

+2


source







All Articles