<div wire:ignore>
    <div class="card col-8 m-auto">
        <div class="card-header d-flex justify-content-between">
            <p>Form/Table Name: <span class="text-primary"><?php echo e($form->name); ?></span></p>
            <a href="<?php echo e(url($from)); ?>" class="btn btn-secondary btn-sm align-self-center" wire:navigate><i class="fas fa-long-arrow-alt-left"></i> Back</a>
        </div>
        <div class="card-body p-5">
            <form method="POST" id="myForm" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <input type="number" id="form_id" name="form_id" value="<?php echo e($form->id); ?>" hidden />
                <input type="text" id="update_id" name="update_id" value="<?php echo e($updateId); ?>" hidden />
                <div id="fb-reader"></div>
                <input type="submit" value="Save" class="btn btn-success" />
            </form>
        </div>
    </div>
</div>

    <?php
        $__assetKey = '305845223-0';

        ob_start();
    ?>
    <script src="<?php echo e(URL::asset('js/jquery-ui-1.13.2.min.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('assets/form-builder/form-render.min.js')); ?>"></script>
    <?php
        $__output = ob_get_clean();

        // If the asset has already been loaded anywhere during this request, skip it...
        if (in_array($__assetKey, \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys)) {
            // Skip it...
        } else {
            \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys[] = $__assetKey;
            \Livewire\store($this)->push('assets', $__output, $__assetKey);
        }
    ?>
    <?php
        $__scriptKey = '305845223-1';
        ob_start();
    ?>
<script>
  $(document).ready(function() {
        $('#fb-reader').formRender({
            formData: <?php echo e(Js::from($content)); ?>

        });
    });


    $(document).ready(function () {
        $('#myForm').submit(function (e) {
            e.preventDefault(); // Prevent default form submission

            // Send Ajax request
            $.ajax({
                url: '<?php echo e(URL('save-form-data')); ?>',
                type: "POST",
                data:  new FormData(this),
                contentType: false,
                cache: false,
                processData:false,
                beforeSend:function(){					

                },
                success: function (response) {
                    if (response.status) {
                        $("#myForm")[0].reset();
                        alert(response.message);
                    }
                },
                error: function (error) {
                    console.error('Error submitting form:', error);
                }
            });
        });
    });

</script>
    <?php
        $__output = ob_get_clean();

        \Livewire\store($this)->push('scripts', $__output, $__scriptKey)
    ?><?php /**PATH C:\laragon\www\marketing_data_analysis\resources\views/livewire/form-builder/read.blade.php ENDPATH**/ ?>