How to toggle the HTML5 input “required” function depending on which button is pressed

I have in my form a textarea input field and I am using the HTML5 required attribute: