You could use HTML5 form validation. Simply make the field required
and give it a pattern
. No JS required (although you might choose a polyfill for old browsers).
Try and submit this form without matching the pattern:
<form>
<input name="myInput"
required="required"
placeholder="Must contain Mickey"
pattern=".*Mickey.*"
title="It must contain Mickey somewhere."
/>
<input type="submit" />
</form>
solved Check If String Exists in Text Field