WordPress usermeta update using wp ajax, jquery

To update all the user meta fields you listed when the save button is clicked, you’ll need to ensure your form includes inputs for each meta field. Then, use AJAX to send all form data to the server and update the respective user meta fields. Here’s the updated implementation:

<form class="a2n-dash_grid" action="#" method="post">
    <div class="form_group">
        <h3 class="a2n_notification">
            Receive Email notifications...
        </h3>
        <div class="label_of_notify">
            <label>
                <input type="radio" name="student_course_subscribed" value="yes" <?php echo $metaVal === 'yes' ? 'checked' : ''; ?>>
                Yes
            </label>
            <label>
                <input type="radio" name="student_course_subscribed" value="no" <?php echo $metaVal === 'no' ? 'checked' : ''; ?>>
                No
            </label>
        </div>
    </div>

    <div class="form_group">
        <h4>Course Start</h4>
        <input type="checkbox" name="student_course_start" value="1" <?php checked($metaValues['student_course_start'], 1); ?>>
    </div>
    <div class="form_group">
        <h4>Course Retake</h4>
        <input type="checkbox" name="student_course_retake" value="1" <?php checked($metaValues['student_course_retake'], 1); ?>>
    </div>
    <!-- Add similar inputs for all the meta fields -->

    <div class="form_submit">
        <input type="submit" value="Save" />
        <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('update_meta_nonce'); ?>">
    </div>
</form>

JavaScript (AJAX)

Capture all form data dynamically and send it via AJAX.

In your functions.php, process all the fields and update them.