Text field data validation

I have placed two input text field and I am inserting some values dynamically through those fields. Now I need to validate those field as string with no special character and number…and another one should be valid by number only. Suggestion and Ideas please.