Implmented the required submit button on javascript