includes/clientside/static/ajax.js
changeset 1252 e34c23a35dc9
parent 1246 330f4de4c937
child 1284 35380c89b5bf
--- a/includes/clientside/static/ajax.js	Sun May 16 21:35:43 2010 -0400
+++ b/includes/clientside/static/ajax.js	Wed Jun 02 21:58:26 2010 -0400
@@ -626,19 +626,12 @@
 	// IE <6 pseudo-compatibility
 	if ( KILL_SWITCH )
 		return true;
-	if(!catlist)
-	{
-		alert('Var catlist has no properties');
-		return;
-	}
-	query='';
-	for(i=0;i<catlist.length;i++)
-	{
-		var s = ( document.forms.mdgCatForm['mdgCat_' + catlist[i]]['checked'] ) ? true : false;
-		if(s) query = query + '&' + catlist[i] + '=true';
-	}
-	setAjaxLoading();
-	query = query.substring(1, query.length);
+	var query = 'hello=';
+	$('.catCheck input:checkbox:checked').each(function(i, e)
+		{
+			query += '&categories[]=' + ajaxEscape($(e).val())
+		});
+	
 	ajaxPost(stdAjaxPrefix+'&_mode=catsave', query, function(ajax) {
 		if ( ajax.readyState == 4 && ajax.status == 200 ) {
 			unsetAjaxLoading();