my Ajax does not show the swal on success or error meaning when am done adding a book…
- User
my Ajax does not show the swal on success or error meaning when am done adding a book and click Add nothing happens despite the PHP working fine. Correct the ajax code: FORM CODE:
code<div class="form-group"> <label>Category</label> <select class="form-control" name="cat_id" required=""> <option value="">No category selected</option> <?php $selAllCategories = $conn->query("SELECT * FROM ged_book_categories ORDER BY id DESC"); while ($selAllCategoriesRow = $selAllCategories->fetch(PDO::FETCH_ASSOC)) { ?> <option value="<?php echo $selAllCategoriesRow['id']; ?>"><?php echo $selAllCategoriesRow['category']; ?></option> <?php } ?> </select> </div> <div class="form-group"> <label>Content</label> <textarea class="form-control editor" id="editGBPost" name="content"></textarea> </div> <div class="form-group"> <label>Select Course</label> <select class="form-control" name="courseSelected" id="coursesGBSelected"> <option value="0">Select Course</option> <?php $selCourse = $conn->query("SELECT * FROM ged_course_tbl ORDER BY cou_id DESC"); if ($selCourse->rowCount() > 0) { while ($selCourseRow = $selCourse->fetch(PDO::FETCH_ASSOC)) { ?> <option value="<?php echo $selCourseRow['cou_id']; ?>"><?php echo $selCourseRow['cou_name']; ?></option> <?php } } else { ?> <option value="0">No Course Found</option> <?php } ?> </select> </div> <div class="form-group"> <label>Select Subject</label> <select class="form-control" name="subjectSelected" id="subjectsGBSelected"> <option value="0">Select Subject</option> </select> </div> <div class="form-group"> <label>Book Status</label> <div class="form-check"> <input class="form-check-input" type="radio" name="bookStatus" id="bookGBStatus1" value="active" checked> <label class="form-check-label" for="bookGBStatus1"> Active </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="bookStatus" id="bookGBStatus2" value="draft"> <label class="form-check-label" for="bookGBStatus2"> Draft </label> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Add Now</button> </div> </fieldset> </div> </div> </div> </form> - Assistant