$(document).ready(function() {
    // Hiding the category panel by default
    $('.categoryPanel').hide();

   
        // Edit Button Clicked
    $('#edit').click(function(e) {
            e.preventDefault();
            hideShow();
        })
        // Cancel Button clicked
    $('#cancel').click(function(e) {
        e.preventDefault(),
        Swal.fire({
            title: 'Cancel Form Submition?',
            text: "Are you sure, you want to cancel the form submission?",
            type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: "Yes",
            cancelButtonText: "No"
        }).then(function (result) {
                if (result.value) {
                    location.reload()
                }
            })
    });

    // Delete button clicked
    $('#delete').click(function(e) {
        e.preventDefault();
        Swal.fire({
            title: 'Cancel Form Submition?',
            text: "Are you sure, you want to cancel the form submission?",
            type: 'error',
            showCancelButton: true,
            confirmButtonColor: '#d33',
            cancelButtonColor: '#3085d6',
            confirmButtonText: "Yes",
            cancelButtonText: "No"
        }).then(function (result) {
                if (result.value) {
                    // YOur real code goes here about deleting the record
                    location.reload();
                }
            })
    })

    function hideShow() {
	    $('input, select, .saveCancel').removeAttr('disabled');
        $('.categoryPanel').show();
        $('.addEditButton').hide();
    }
});