Okay
  Print

Career Form Email not working

Hi,

  Replace the career from javascript code in custom.js as follows:


/* --------------------------------------------
    Career Form
    -------------------------------------------- */    
    careersform: function(){    
        if ( $( "#careerform" ).length !== 0 ) {
        $('#careerform').bootstrapValidator({
                container: 'tooltip',
                feedbackIcons: {
                    valid: 'fa fa-check',
                    warning: 'fa fa-user',
                    invalid: 'fa fa-times',
                    validating: 'fa fa-refresh'
                },
                fields: {
                    career_name: {
                        validators: {
                            notEmpty: {
                                message: ''
                            }
                        }
                    },
                    career_email: {
                        validators: {
                            notEmpty: {
                                message: ''
                            },
                            emailAddress: {
                                message: ''
                            }
                        }
                    },
                    career_phone: {
                        validators: {
                            notEmpty: {
                                message: ''
                            }
                        }
                    },
                    career_file: {
                        validators: {
                            notEmpty: {
                                message: 'Please Upload pdf or doc or docx file'
                            },
                            file: {
                                extension: 'pdf,doc,docx',
                                type: 'application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword',
                                message: 'The selected file is not valid!'
                            }
                        }
                    },
                }
            })    
            .on('success.form.bv', function(e) {
                e.preventDefault();
                
                var $form       = $(e.target);
                validator        = $form.data('bootstrapValidator'),
                submitButton     = validator.getSubmitButton();
                
                var formData = new FormData(),
                params   = $form.serializeArray(),
                files    = $form.find('[name="career_file"]')[0].files;
                
                $.each(files, function(i, file) {
                    // Prefix the name of uploaded files with "uploadedFiles-"
                    // Of course, you can change it to any string
                    formData.append('career_file-' + i, file);
                });
    
                $.each(params, function(i, val) {
                    formData.append(val.name, val.value);
                });
                
                $.ajax({
                        type: "POST",
                        dataType: 'json',
                        url: "php/career.php",                    
                        data: formData,
                        cache: false,
                        contentType: false,
                        processData: false,
                        success: function(msg){                        
                            $('.form-message2').html(msg.data);
                            $('.form-message2').show();
                            submitButton.removeAttr("disabled");
                            resetForm($('#careerform'));                        
                        },
                        error: function(msg){}
                 });
                return false;
            });
        }        
        function resetForm($form) {
            $form.find(
                    'input:text, input:password, input, input:file, select, textarea'
                )
                .val('');
            $form.find('input:radio, input:checkbox')
                .removeAttr('checked')
                .removeAttr('selected');
            $form.find('button[type=submit]')
                .attr("disabled", "disabled");
                
        }
    },    

Also replace the attached file career.php in php folder File attached in link).

https://www.dropbox.com/s/57ho2bzv0mijfv9/career%20-%20normal.php?dl=0 --> normal email
https://www.dropbox.com/s/uobx1kjw4h9z88g/career%20-%20smtp.php?dl=0 --> smtp email