Adding client-side validation to gist creation

Because of no client side validation, when validation failed for a gist, it would remove all input values. 

This PR solves it by adding  a simple client side  validation, so at least the form won't submit and no information will be lost in most cases.

Related to #5