Hi Please have a look at this post,Link:-
http://stackoverflow.com/questions/26192217/how-to-make-textfield-required-using-listenersDialog:
Listener
JavaScript:MyDialog.setRequired = function(field,value) { var dialog =
field.findParentByType("dialog"), email = dialog.getField('./email1');
if('url' == value) { email.allowBlank = true; }else{ email.allowBlank =
false; } }; I hope this will help you.Thanks and regardsKautuk Sahni