We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28456
    • 83 Posts
    Hello,

    I try to make a form with AjaxForm but it will not work properly. The normal Formit form works correct on my server.
    I follow the instructions with no success.

    installed Formit
    installed AjaxForm 1.1.9-pl

    My snippet call
    [[!AjaxForm?
    &form=`myAjaxForm`
    &snippet=`FormIt`
    &hooks=`email,redirect`
    &emailTpl=`MyEmailChunk`
    &emailto=`[email protected]`
    &redirectTo=`1`
    &validate=`name:required,
    		   email:email:required,
    		   message:required:stripTags`
    ]]


    My Form
    <form action="" method="post" class="ajax_form af_example">
    
        <div class="form-group">
            <label class="control-label" for="af_name">[[%af_label_name]]</label>
            <div class="controls">
                <input type="text" id="af_name" name="name" value="[[+fi.name]]" placeholder="" class="form-control"/>
                <span class="error_name">[[+fi.error.name]]</span>
            </div>
        </div>
    
        <div class="form-group">
            <label class="control-label" for="af_email">[[%af_label_email]]</label>
            <div class="controls">
                <input type="email" id="af_email" name="email" value="[[+fi.email]]" placeholder="" class="form-control"/>
                <span class="error_email">[[+fi.error.email]]</span>
            </div>
        </div>
    
        <div class="form-group">
            <label class="control-label" for="af_message">[[%af_label_message]]</label>
            <div class="controls">
                <textarea id="af_message" name="message" class="form-control" rows="5">[[+fi.message]]</textarea>
                <span class="error_message">[[+fi.error.message]]</span>
            </div>
        </div>
    
        <div class="form-group">
            <div class="controls">
                <button type="reset" class="btn btn-default">[[%af_reset]]</button>
                <button type="submit" class="btn btn-primary">[[%af_submit]]</button>
            </div>
        </div>
    
        [[+fi.success:is=`1`:then=`
        <div class="alert alert-success">[[+fi.successMessage]]</div>
        `]]
        [[+fi.validation_error:is=`1`:then=`
        <div class="alert alert-danger">[[+fi.validation_error_message]]</div>
        `]]
    </form>


    Regards
    Stefan
      • 38783
      • 571 Posts
      Does it work without the redirect? ie if you remove: &hooks=`redirect` and &redirectTo=`1`.
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 28456
        • 83 Posts
        @andy
        No that was not the problem.
        here is a link to my test form
        http://stefan-as.nl/ajax.html
          • 38783
          • 571 Posts
          I have just filled in the form. Although it appeared not to work, did you receive a message from it?
            If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

            email: [email protected] | website: https://andytough.com
            • 28456
            • 83 Posts
            @andy
            no