Make AJAX new line form work again

FIXME: Factorize!
Merge pull request #1311 from GPCsolutions/develop-fixaddline

Make AJAX new line form work again