A few Questions about Monatana-Theme

Hey guys,

i have some questions about the Montana-Theme.

  1. the contact.html function:
    I got the function working with PHPMailer in contact_process.php. So far so good.
    But unfortunately there is no message for the client that the mail was successfully sent.
    I tried with an return in contact_process.php:
    $data = [
       'success' => $success,
       'message' => $message ,
    ];
    echo json_encode($data);

That should probably give a response to the contact.js

$(document).ready(function(){
    
    (function($) {
        "use strict";

    
    jQuery.validator.addMethod('answercheck', function (value, element) {
        return this.optional(element) || /^\bHaus\b$/.test(value)
    }, "Die eingegebene Antwort ist falsch.");

    // validate contactForm form
    $(function() {
        $('#contactForm').validate({
            rules: {
                name: {
                    required: true,
                    minlength: 2
                },
                subject: {
                    required: true,
                    minlength: 4
                },
                number: {
                    required: true,
                    minlength: 5
                },
                email: {
                    required: true,
                    email: true
                },
                message: {
                    required: true,
                    minlength: 20
                },
                input_answer: {
                    required: true,
                    answercheck: true
                },
                consent_check: {
                    required: true,
                    checked: true
                }
            },
            messages: {
                name: {
                    required: "Bitte geben Sie Ihren Namen ein",
                    minlength: "Ihre Eingabe muss mindestens 2 Zeichen enthalten"
                },
                subject: {
                    required: "Bitte geben Sie einen Betreff ein",
                    minlength: "Der Betreff muss mindestens 4 Zeichen enthalten"
                },
                number: {
                    required: "come on, you have a number, don't you?",
                    minlength: "your Number must consist of at least 5 characters"
                },
                email: {
                    required: "Bitte geben Sie Ihre E-Mail-Adresse ein"
                },
                message: {
                    required: "Bitte geben Sie eine Nachricht ein",
                    minlength: "Ihre Nachricht muss mindestens 20 Zeichen enthalten"
                },
                input_answer: {
                    required: "Bitte beantworten Sie die Sicherheitsfrage"
                },
                consent_check: {
                    checked: "Bitte bestätigen Sie die Datenschutzbestimmungen"
                }
            },
            submitHandler: function(form) {
                $(form).ajaxSubmit({
                    type:"POST",
                    data: $(form).serialize(),
                    url:"contact_process.php",
                    success: function(response) {
                        if (response.success){
                            $('#contactForm :input').attr('disabled', 'disabled');
                            $('#contactForm').fadeTo( "slow", 1, function() {
                                $(this).find(':input').attr('disabled', 'disabled');
                                $(this).find('label').css('cursor','default');
                                $('#success').fadeIn()
                                $('.modal').modal('hide');
                                $('#success').modal('show');
                            }) 
                        }
                    },
                    error: function() {
                        $('#contactForm').fadeTo( "slow", 1, function() {
                            $('#error').fadeIn()
                            $('.modal').modal('hide');
                            $('#error').modal('show');
                        })
                    }
                })
            }
        })
    })
        
 })(jQuery)
})

And normally the function succes: function(response) should be triggered.
Do anyone have a clue?

  1. The second is about to add a checkbox wich has to be checked and validated by contact.js.
    I implemented the checkbox in contact.html like:
                                <div class="col-12">
                                    <div class="form-group">
                                        <div class="primary-checkbox">
                                            <input type="checkbox" id="consent_check">
                                            <label for="consent_check"></label>
                                        </div><p>Ich stimme den <a href="datenschutz.html" target="_blank">Datenschutzbestimmungen</a> zu.</p>
                                    </div>
                                </div>

but it wont work. The mail is sent without an activated checkbox.
I tried to add a rule in contact.js (as you can see above) - but i think i made a mistake
How do I implement the checkbox correctly?

thank you very much

Hi there

@jameswiliamsons144 its not one of our theme, so, you need to contact to the author

Regards