Home Ionic 3 - Validate inputs with the same name

# Ionic 3 - Validate inputs with the same name

Mike Wells
1#
Mike Wells Published in 2018-02-13 14:53:13Z
 I am in Ionic 3. I have a JSON feed that has lots of questions in it. I can grab the feed and display all the questions no problems. I just want to validate the answer areas as not null or not empty. I can target a field like a username or password by name, no problems. In PHP/HTML I'd use a field name of 'answer[]' and then check each one in turn. I'm just a bit lost as to how to do this in Ionic. Thanks in advance. [edited] My JSON feed is this: { "status":"success","data":[ {"question":"Question 1"}, {"question":"Question 2"}, {"question":"Question 3"} ] }  I then set the data like this in the ts: var JSONObject = myStaticData.data; this.questions = JSONObject;  Then in view I do this to show them: 
{{ i + 1 }}.

{{ question.question }}

 How do I validate each textarea to not be empty?
 You need to login account before you can post.
Processed in 0.342282 second(s) , Gzip On .