[TYPO3-english] formhandler and multiple ajax forms

Alexander Dorn debao84 at googlemail.com
Wed Sep 12 17:42:22 CEST 2012


Hi,

I found the code that causes the problem, but I don't have a clue how to fix it.

On line 36 of class Tx_Formhandler_Utils_AjaxSubmit the predefined form settings should be loaded.
$settings['usePredef'] = $this->globals->getSession()->get('predef');

However this does not happen with the form mentioned before (again, the other forms work fine). 

Maybe the session is not updated properly?! But why does it only affect this form?

Regards 
Alexander


Am 12.09.2012 um 15:18 schrieb Alexander Dorn:

> Hi,
> 
> I got a page with four different forms that are submitted via ajax.
> 
> I use following versions.
> formhandler 	v1.4
> typo3		v4.6
> 
> Three of them work fine, doing what they are supposed to do.
> 
> When I try to submit the last form (contact form based on http://examples.typo3-formhandler.com/basic-forms/contact-form/) I get a  "template not found" error
> 
> although the form is rendered correctly when loading the page.
> 
> The template definitely exists since the form works without ajax submission.
> 
> Any ideas?
> 
> Thank you
> Alexander
> 
> Form Typoscript
> plugin.Tx_Formhandler.settings.predef.kontaktformular {
> #  debug = 1
>  # This is the title of the predefined form shown in the dropdown box in the plugin options.
>  name = Kontakt
> 
>  # All form fields are prefixed with this values (e.g. contact[name])
>  formValuesPrefix = contact
> 
>  langFile.1 = TEXT
>  langFile.1.value = {$formhandlerExamples.basic.kontaktformular.rootPath}/lang/lang.xml
> 
> #  templateFile = TEXT
>  templateFile = {$formhandlerExamples.basic.kontaktformular.rootPath}/html/step-1.html
> 
>  # The master template is a file containing the markup for specific field types or other sub templates (e.g. for emails). You can use these predefined markups in your HTML template for a specific form.
>  masterTemplateFile = TEXT
>  masterTemplateFile.value = fileadmin/templates/ext/formhandler/mastertemplate.html
> 
>  # These wraps define how an error messages looks like. The message itself is set in the lang file.
>  singleErrorTemplate {
>    totalWrap = <div class="error">|</div>
>    singleWrap = <span class="message">|</span>
>  }
> 
>  # This block defines the error checks performed when the user hits submit.
>  validators {
>    1.class = Validator_Default
>    1.config.fieldConf {
>      name.errorCheck.1 = required
>      email.errorCheck.1 = required
>      email.errorCheck.2 = email
>      message.errorCheck.1 = required
>    }
>  }
> 
>  ajax {
>    class = AjaxHandler_JQuery
> 
>    config {
>      ajaxSubmit = 1
>      submitButtonSelector = .Tx-Formhandler #contact INPUT[type=\'submit\']
> 
>      loading = <span class="ajaxLoader"><img src="fileadmin/templates/img/ajax-loader.gif" /></span>
>      ajaxSubmitLoader = <span class="ajaxLoader"><img src="fileadmin/templates/img/ajax-loader.gif" /></span>
> 
> 
>    }
> 
>  }
>  # Finishers are called after the form was submitted successfully (without errors).
>  finishers {
> 
>    # Finisher_Mail sends emails to an admin and/or the user.
>    1.class = Finisher_Mail
>    1.config {
>      checkBinaryCrLf = message
>      admin {
>        templateFile = TEXT
>        templateFile.value = {$formhandlerExamples.basic.kontaktformular.rootPath}/html/email-admin.html
>        sender_email = info at example.com
>        to_email = info at example.com
>        subject = TEXT
>        subject.data = LLL:{$formhandlerExamples.basic.kontaktformular.rootPath}/lang/lang.xml:email_admin_subject
>      }
>    }
> 
>    # Finisher_Redirect will redirect the user to another page after the form was submitted successfully.
>    5.class = Finisher_SubmittedOK
>    5.config {
>      returns = 1
>    }
>  }
> }
> 
> Typoscript where the form is inserted
> temp.footerContact = COA
> temp.footerContact {
>  ...
>  20 < plugin.tx_formhandler_pi1
>  20.settings < plugin.Tx_Formhandler.settings.predef.kontaktformular
>  ...
> }
> 
> lib.footer = COA
> lib.footer {
>  10 < temp.rightFooterCol
>  20 < temp.footerContact
>  30 < temp.footerRight
> }
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list