This seems to work fine, although I have had to ignore method field embedded in the form to ensure it uses POST for /hosts/template_selected, otherwise redirects back to host page & messes up getting the correct templates.