How to Upload file using jQuery AJAX with Validation in CakePHP 4

Asynchronous file upload gives the user a more seamless experience by allowing them to upload files without having to reload the page.

Handle the file on the client side using jQuery and JavaScript, send the file to the server using an AJAX request, and then process the file on the server.

If the file is not validated then you can immediately display the error messages.

In this tutorial, I show how you can upload file using jQuery AJAX with validation and display a preview of it after uploading it in CakePHP 4.

How to upload file using jQuery AJAX with Validation in CakePHP 4

Read more

Reorder images and save to MySQL database – CodeIgniter 4

Using jQuery UI sortable you can enable HTML element dragging on your page.

Initialize it on the element that you want to allow the users to reorder.

In this tutorial, I show how you can reorder images using jQuery UI and save them to the MySQL database in CodeIgniter 4.

Reorder images and save to MySQL database - CodeIgniter 4

Read more

Allow Only One Checkbox to be Checked using jQuery and JavaScript

HTML checkboxes are commonly used to enable users to select multiple items from a list, while radio buttons are used for exclusive single selections.

However, there are instances where a checkbox is preferred over a radio button, even when only one option should be selected.

In this tutorial, I show how you can allow only one checkbox selection using jQuery and JavaScript.

Allow Only One Checkbox to be Checked using jQuery and JavaScript

Read more