add pattern attribute for number fields