formate code; added if case for form actions with externat links