Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Html employment row -->
- <div class="row employment_block">
- <div class="col-md-3">
- <input type="text" name="job_title[]" placeholder="Job title">
- </div>
- <div class="col-md-3">
- <input type="text" name="job_duration[]" placeholder="Duration (i.e. 3 months / 1 year)">
- </div>
- <div class="col-md-3">
- <input type="text" name="job_location[]" placeholder="Country">
- </div>
- <div class="col-md-3 text-center">
- <button href="#" class="able_btn m-0 w-100 disabled" disabled aria-disabled="true" style="opacity:0.5"> remove </button>
- </div>
- </div>
- <!-- AJAX on form submit -->
- $(document).ready(function(){
- $(".account_cv_update_form").submit(function(evt){
- evt.preventDefault();
- var formData = new FormData($(this)[0]);
- $.ajax({
- url: 'handlers/cv_update.php',
- type: 'POST',
- data: formData,
- async: false,
- cache:false,
- contentType: false,
- processData: false,
- dataType: "json",
- success: function (response) {
- switch(response.message){
- case 'success': success();
- break;
- case 'error': error();
- break;
- }
- }
- });
- return false;
- });
- });
- <!-- PHP handler code / json encoding array-->
- $job_title = $_POST['job_title'];
- $job_duration = $_POST['job_duration'];
- $job_location = $_POST['job_location'];
- $json_data = array(
- 'job_title' => $job_title,
- 'job_location' => $job_location,
- 'job_duration' => $job_duration );
- $cv_data = json_encode($json_data);
- echo json_encode($response);
- exit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement