Archives for January 2007

Dynamically Populating a Select Box Using AJAX

[ Demo and Source Code (PHP) ]
AJAX is actually not that difficult. All you need to know is some basic XML, and how to iterate through the XML tree structure using Javascript.
As in my previous post, there are two select boxes, City and Country, and the contents of City should reflect that of the selected country. […]

21 January 2007 | AJAX, HTML, Javascript | No Comments

Dynamically Populating a Select Box Using a Hidden Iframe

Let’s say you have two select boxes, Country and City. The contents of City should reflect that of the selected country. A hidden iframe may be used to do this without having to reload the page.
The concept is to use the onchange event of Country to specify the src of the hidden iframe. Server-side code […]

20 January 2007 | HTML, Javascript | No Comments

Never Forget to RTFM

This week I got reminded of the first rule of CS: RTFM. I wanted to use the HTML input tag with type=”image”. In one page everything was fine but in another I got totally bizarre behaviour. After a few days of distracted head-scratching I opened the HTML 4.01 Specification (W3C Recommendation 24 December 1999). The […]

2 January 2007 | HTML, Javascript | No Comments