ajax implementation in register