add ajax for add_template_form.php