function populate_region_select(selected_region_id, parent_region_id) { // selected_region_id: The region that is currently selected (for postback) // parent_region_id: The region to get all the child regions from $.ajax({ type: 'GET', url: '/get_regions.php', data: 'parent_region_id=' + parent_region_id + '&selected_region_id=' + selected_region_id, dataType: 'text/html', success: function(html) { $('#region_select').html(html); } }); } function check_url(url_to_check) { $.ajax({ type: 'GET', url: '/check_url.php', data: 'url=' + url_to_check, dataType: 'text/html', success: function(html) { $('#url_check_result').html(html); } }); } function text_counter(field, countfield, maxlimit) { if (field.value.length > maxlimit) // if too long...trim it! field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter else countfield.value = maxlimit - field.value.length; } function add_text_hint(elem, hintText) { if (elem.value == '') { elem.value = hintText; elem.style.className = 'ghost'; } elem.onfocus = function () { if (elem.value == hintText) { elem.value = ''; } } elem.onblur = function () { if (elem.value == '') { elem.value = hintText; } } }