add some documentation
javascript part of valiadtion