Changing application js to ajax submit entry