Dr.Ajay Kashyap

Dr.Ajay Kashyap

  • NA
  • 521
  • 285.1k

validation for 5 text box have different values or not

Feb 6 2017 4:23 AM
hello Sir ...
i have minmum 1 and maximum 5 textbox and textbox are created dynamic when user click on add button ...now when user click on submit button i want to validate that every textbox have different value if there is same value then show alert same Value not allow.
 
this all i want using javascript / jquery. 
 
I am Storing The Value Like This ...  Now How To Validate 
 
var Category1 = $("input[name='[0].Category']").val();
var Category2 = $("input[name='[1].Category']").val();
var Category3 = $("input[name='[2].Category']").val();
var Category4 = $("input[name='[3].Category']").val();
var Category5 = $("input[name='[4].Category']").val();
 

Answers (1)