Ajax form handling improvements