Currently, I am utilizing angular 4 and symfony3. In my application, there is a textarea that is required. However, when I only press enter (code 13) in this textarea without entering any other character, the form gets submitted. How can I prevent this specific scenario from happening?
Below is the TypeScript code snippet:
createFormControls() {
this.commentContent = new FormControl('', Validators.required);
}
Additionally, here is the symfony code section for reference:
/**
* @var string
*
* @ORM\Column(name="content", type="text")
*
* @Assert\NotBlank(message="content is empty")
*
* @Serializer\Groups({"details"})
*/
private $content;