1st personal encounter with Ajax
Thursday, 9. February 2006, 10:45:50
Yesterday i was cleaning up my project's registration form (script, css, layout). The same big form with lots of fields. 4 of them are for defining users geographical location (country, county, district, city; more on that - here). So i decided to make it more comfortable (read: idiot-proof).
Country list: check if chosen countr is Lithuania;
yes) activate county list;
no) deactivate county, district and city lists;
County list: check if user has chosen county;
yes) retrieve district list of districts for certain county and activate district list;
no) do not activate district and city lists;
(Todo)
District list: check if user has chosen valid district;
yes) retrieve list of cities for certain district and activate city list;
no) do not activate city list;
I haven't done the latter one 'cause i didn't find someone who could assign all the cities (total: 103) to all the districts (total: 53). Quite a bloody work.
In conclusion i must say, that Ajax really made registration more comfortable. If you're wondering if it's hack proof - all data checks are done on the server-side php script with all mistake reporting (if user is a bigger idiot than i expected him/her to be). It has broadend knoledge of JavaScript for me as well (i was testing registration form on three browsers: IE6, FF1.5 and Opera). So far so good!
Country list: check if chosen countr is Lithuania;
yes) activate county list;
no) deactivate county, district and city lists;
County list: check if user has chosen county;
yes) retrieve district list of districts for certain county and activate district list;
no) do not activate district and city lists;
(Todo)
District list: check if user has chosen valid district;
yes) retrieve list of cities for certain district and activate city list;
no) do not activate city list;
I haven't done the latter one 'cause i didn't find someone who could assign all the cities (total: 103) to all the districts (total: 53). Quite a bloody work.
In conclusion i must say, that Ajax really made registration more comfortable. If you're wondering if it's hack proof - all data checks are done on the server-side php script with all mistake reporting (if user is a bigger idiot than i expected him/her to be). It has broadend knoledge of JavaScript for me as well (i was testing registration form on three browsers: IE6, FF1.5 and Opera). So far so good!












