Skip to main content
Gautham Saudagar (Slalom LLC) 님이 #Collaboration에 질문했습니다
Hi Guys!, I'm using ui:InputTextArea in my lightning component. I want to put validation on it so that the field should not be empty. It is a required field. However when I enter a space it is allowing to save. Anyone have any idea on how I can put empty validation on ui:InputTextArea?

 

Thanks!
답변 11개
  1. 2018년 11월 13일 오후 4:23

    I see! In that case you will need to do something like this:

    var FieldValue = component.find("auraId").get("v.value");

    var str=FieldValue.replace(/ /g, '')); // This will remove all the spaces in the string.

    if($A.util.isEmpty(str)){

    }

     

     
0/9000