Function to create html form tag, including assertion of correct attributes