Code examples

PHP + JavaScript shopping cart with image effects

PHP + JavaScript shopping cart with image effects

This is an example of a responsive shopping cart application with zoom image effects. You can add or remove products, click on product image which leads you to a product page where you can observe image JavaScript zoom effect as you hover over product image. Built with Bootstrap 5, PHP and JavaScript.

JavaScript modal window example

JavaScript modal window example

This is an example of how modal window built with ES-6 and modern JavaScript and CSS features can look like. Modal windows can be used for various reasons, like for example call to action buttons, quick newsletter contact forms or cookie compliance statements and quick notifications. I have built this example with pure JavaScript and CSS, no external libraries are included or necessary to run this code.

Vue.js regex form validation

Vue.js regex form validation

This is a Vue.js form validation with a little help from regular expressions. The important part here is to pay attention to preventDefault method in combination with the errors array or success message array after the submit event has been triggered. Regular expressions are the only waterproof tool to sanitize the inputs although the browser and the HTML itself can be used for this purpose if you do not want to spend some time on analyzing and writing down the regex yourself.

PHP string cleaner

PHP string cleaner

This example uses two regular expressions to strip the inserted string of all symbols, extra hyphens and extra white spaces so the end result is a clean text structure that contains lowercase words, and only one hyphen between each word. This has many use-case scenarios, for example, you can use it in a custom CMS for inserting clean SEO friendly blog titles, or url-s, based on the text that the author inserts in the input field.

PHP + Bootstrap 4 shopping cart

PHP + Bootstrap 4 shopping cart

This is a Bootstrap 4 + PHP + jQuery responsive shopping cart example, using Php filter_input function, and few other concepts and basic control flow statements.

jQuery + Bootstrap 4 contact form validation

jQuery + Bootstrap 4 contact form validation

Interactive Bootstrap 4 + jQuery contact form with multiple client side validations. Very simple, but useful.