[Mapbender-commits] r8320 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Apr 19 03:25:43 EDT 2012


Author: verenadiewald
Date: 2012-04-19 00:25:43 -0700 (Thu, 19 Apr 2012)
New Revision: 8320

Modified:
   trunk/mapbender/http/plugins/mb_print.php
Log:
validate maxlength parameter for textarea elements

Modified: trunk/mapbender/http/plugins/mb_print.php
===================================================================
--- trunk/mapbender/http/plugins/mb_print.php	2012-04-19 07:24:36 UTC (rev 8319)
+++ trunk/mapbender/http/plugins/mb_print.php	2012-04-19 07:25:43 UTC (rev 8320)
@@ -600,6 +600,14 @@
 			str += '</div>\n';
 		}
 		if (str) {
+			$('textarea[maxlength]').live('keyup change', function() {
+              	var str = $(this).val()
+              	var mx = parseInt($(this).attr('maxlength'))
+              	if (str.length > mx) {
+                 	$(this).val(str.substr(0, mx))
+                 	return false;
+              	}
+            });
 			$("#" + myId + "_formsubmit").before(str);
 			$("#scale").keydown(function (e) {
 				if (e.keyCode === 13) {



More information about the Mapbender_commits mailing list