HTML 5 has introduced Javascript plug-ins to achieve something similar effect. But these code will only work in Safari 5, Chrome 6, Opera 9, Firefox 4 Beta and the iPhone/iPad. Also each browser has a slightly different default behaviour. The "required " attribute The simplest change you can make to your forms is to mark a text input field as 'required':