PLD-doc: PLD_www_res/buildlogs/index.php - allow easy checkboxes t...
vip
vip at pld-linux.org
Sat Apr 21 22:31:21 CEST 2007
Author: vip Date: Sat Apr 21 20:31:21 2007 GMT
Module: PLD-doc Tag: HEAD
---- Log message:
- allow easy checkboxes toggle in advanced search
---- Files affected:
PLD-doc/PLD_www_res/buildlogs:
index.php (1.88 -> 1.89)
---- Diffs:
================================================================
Index: PLD-doc/PLD_www_res/buildlogs/index.php
diff -u PLD-doc/PLD_www_res/buildlogs/index.php:1.88 PLD-doc/PLD_www_res/buildlogs/index.php:1.89
--- PLD-doc/PLD_www_res/buildlogs/index.php:1.88 Fri Sep 15 20:16:37 2006
+++ PLD-doc/PLD_www_res/buildlogs/index.php Sat Apr 21 22:31:16 2007
@@ -753,13 +753,21 @@
$big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
+ echo "<script><!--\n".
+ "function checkboxToggle() {\n".
+ "for (var i=0;i<document.forms[0].elements.length;i++) {\n".
+ "var e = document.forms[0].elements[i];\n".
+ "if ((e.name != 'all') && (e.type=='checkbox'))\n".
+ "e.checked = document.forms[0].all.checked;\n".
+ "}\n }\n -->\n </script>\n";
+
echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
echo "<div align=\"center\">";
echo "<table border=\"0\">\n";
echo "<tr>\n";
echo "<td>"._("Package name")."</td>\n";
- echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST[name]."\"/></td>\n";
+ echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST["name"]."\"/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
@@ -788,15 +796,15 @@
echo "<tr>\n";
$name="as0_".$i;
$check=" checked=\"on\"";
- echo "<td><input name=\"$name\" type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
+ echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
$name="as1_".$i;
$check=" checked=\"on\"";
- echo "<td><input name=\"$name\" type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
+ echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
- echo "<td><input type=\"submit\" name=\"submit\" value=\""._("Search!")."\" /></td>";
+ echo "<td><input name=\"all\" type=\"checkbox\" checked=\"on\" onClick=\"checkboxToggle()\">"._("Toggle checkboxes")." <input type=\"submit\" name=\"submit\" value=\""._("Search!")."\" /></td>";
echo "</tr>\n";
echo "</table>\n";
================================================================
---- CVS-web:
http://cvs.pld-linux.org/PLD-doc/PLD_www_res/buildlogs/index.php?r1=1.88&r2=1.89&f=u
More information about the pld-cvs-commit
mailing list