In the previous post,’Create Dynamic Date Selects‘, we ended up with select lists for the Month, Day and Year. In this post, we’ll make these more intuitive by only displaying the correct number of days for a given month/year combination; Continue reading »

 

If you ever require users to submit a date using an online form, perhaps a birthday or an expiry date, a good way to eliminate spelling mistakes and format the submitted date how you want is to provide drop down ‘select’ elements. Using PHP, we can easily create dynamic select elements for the day, month and year.

Continue reading »

 

An example of what you’re creating can be seen here.

The complete script can be downloaded here AjaxRequest (30.91 KB) Create your first AJAX Request :)

In the first part, we created a function, getRequestObj(), that we can now use to initiate a new XMLHttpRequest object. Continue reading »

 

We’ve already covered ‘creating a random image with JavaScript’ but the best way to produce a random image on each page load is to use PHP. Using PHP, you are not relying on the browser supporting JavaScript at all and everyone will see the random images.

OK, to start, we’ll create a function called randomSelect(). This will take two parameters; the directory to scan for images and an array of the allowed file extensions to use.

Continue reading »

 

To make it easier for your visitors to visually separate similar elements in your web page (such as table rows, paragraphs, list items etc), you can give alternate elements a different background colour. You can achieve this using a server-side script but here’s a really simple way to do this using JavaScript.

Continue reading »

 

If you have required fields in a form, a nice visual clue for the user is to have a message ‘pop up’ if the field hasn’t been filled in. A simple example of what I mean can be seen here.

Continue reading »

© 2012 ElanManSuffusion theme by Sayontan Sinha

Page optimized by WP Minify WordPress Plugin