'Create a new form definition.'

def create_form(self, name, description, form_type, field_type='TextField', form_layout_name='', num_fields=1, num_options=0, field_name='1_field_name', strings_displayed=[], strings_displayed_after_submit=[]):

    self.visit_url(('%s/forms/create_form_definition' % self.url))
    for check_str in strings_displayed:
        self.check_page_for_string(check_str)
    tc.fv('create_form_definition', 'name', name)
    tc.fv('create_form_definition', 'description', description)
    tc.fv('create_form_definition', 'form_type_select_field', form_type)
    tc.submit('create_form_button')
    if (form_type == 'Sequencing    Sample    Form'):
        tc.submit('add_layout_grid')
        tc.fv('edit_form_definition', 'grid_layout0', form_layout_name)
    if (num_fields == 0):
        tc.submit('remove_button')
    for index1 in range(num_fields):
        field_label = ('field_label_%i' % index1)
        field_contents = field_type
        field_help_name = ('field_helptext_%i' % index1)
        field_help_contents = ('Field    %i    help' % index1)
        field_default = 'field_default_0'
        field_default_contents = ('%s    default    contents' % form_type)
        tc.fv('edit_form_definition', field_label, field_contents)
        tc.fv('edit_form_definition', field_help_name, field_help_contents)
        if (field_type == 'SelectField'):
            self.refresh_form('field_type_0', field_type)
            if (num_options == 0):
                num_options = 2
            for index2 in range(1, (num_options + 1)):
                tc.submit('addoption_0')
            for index2 in range(num_options):
                option_field_name = ('field_0_option_%i' % index2)
                option_field_value = ('Option%i' % index2)
                tc.fv('edit_form_definition', option_field_name, option_field_value)
        else:
            tc.fv('edit_form_definition', 'field_type_0', field_type)
        tc.fv('edit_form_definition', 'field_name_0', field_name)
        tc.fv('edit_form_definition', field_default, field_default_contents)
    tc.submit('save_changes_button')
    for check_str in strings_displayed_after_submit:
        self.check_page_for_string(check_str)
