Added JS validation for year field and fix JS behaviour.

#5816 

This PR addresses https://github.com/openscholar/openscholar/issues/5816#issuecomment-40486330 and adding JS validation to the field as requested in https://github.com/openscholar/openscholar/pull/5862#issuecomment-40307574

Upon wrong input or input of numbers in wrong length:
![selection_076](https://cloud.githubusercontent.com/assets/4497748/2716403/801b217e-c529-11e3-9275-719a540fa989.png)