cq5 - How to make textfield required using listeners -
cq5 - How to make textfield required using listeners - i have listener on selector hide , show textfield based upon selected value. want implement value show should mandatory fill in. used allowdblank true within listener didn't work. below listener. function(selection,record,path) { var dialog=selection.findparentbytype('panel'); var email = dialog.getcomponent('email1'); var url = dialog.getcomponent('url1'); if(record == 'email'){ url.hide(); url.setvalue(""); email.show(); //how create email manadory } if(record == 'link'){ email.hide(); email.setvalue(""); url.show(); } } thanks i've used "allowblank" on selectionchanged listener. i've used toggle fields required/not-required many times. here's working code adapted illustration (i omitted parts don't relate required field). using getfield method instead of getcomponent well: dialog: ...