Refine 'pattern' and 'required' attributes on dialog fields

@gaurave
same as above.