       inDuration: 0,
       linkClass: ".#{@linkClass}",
       remoteAjax: this.ajaxEvents(),
-      formOptions:
-        success: (data) =>
-          # console.log "Successful form POST"
-          true
-        beforeSubmit: (data) =>
-          console.log "Sending these data to the server: #{JSON.stringify(data)}"
     this.formwizardEnabled = true
 
   setHiddenInput: (name, value, id, classes = "", scope = @form) ->

        this.addDefaultButtons($step)
        this.updateSteps()

  bindEvents: ->
    @form.bind "step_shown", (event, data) =>
      this.setCurrentStepField()
      this.clearNextStepField()
      this.setFormFields(hatTrick.model)
      this.setupButtonsForCurrentStep()

    @form.bind "after_remote_ajax", (event, data) =>
      if hatTrick.data.hatTrickStepContents?
        this.setContents(hatTrick.data.hatTrickStepContents)

      if hatTrick.metadata?.currentStep.buttons?
        stepId = hatTrick.metadata.currentStep.fieldset
        this.buttons[stepId] = hatTrick.metadata.currentStep.buttons

      if hatTrick.metadata?.currentStep?.repeatOf?
        this.repeatStep(hatTrick.metadata.currentStep)
      else if hatTrick.metadata?.currentStep?
        this.showStep(hatTrick.metadata.currentStep.fieldset)

$ ->
  $form = $("form.wizard")

    this.setRadioButtons(model)

  createButton: (name, label) ->
    """<input type="button" class="wizard_button" name="#{name}" value="#{label}" />"""

  setButton: (stepId, name, label) ->
    $buttonsDiv = $("fieldset##{stepId}").find("div.buttons")
    switch name
      when "next"
        # console.log "Setting #{stepId} submit button val to #{label}"
        $button = $buttonsDiv.find('input:submit')
        unless $button.length > 0
          $button = $('<input class="wizard_button wizard_next" type="submit" />').appendTo $buttonsDiv
        $button.val(label)
      when "back"
        # console.log "Setting reset button val to #{label}"
        $button = $buttonsDiv.find('input:reset').val(label)
        unless $button.length > 0
          $button = $('<input class="wizard_button wizard_back" type="reset" />').appendTo $buttonsDiv
        $button.val(label)
      else
        buttonSelector = """input:button[name="#{name}"][value="#{label}"]"""
