[Mapbender-commits] r4765 - branches/2.6/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Sep 30 04:14:50 EDT 2009


Author: topi
Date: 2009-09-30 04:14:47 -0400 (Wed, 30 Sep 2009)
New Revision: 4765

Modified:
   branches/2.6/http/php/mod_meetingPoint.php
Log:
http://trac.osgeo.org/mapbender/ticket/537

Modified: branches/2.6/http/php/mod_meetingPoint.php
===================================================================
--- branches/2.6/http/php/mod_meetingPoint.php	2009-09-29 18:38:43 UTC (rev 4764)
+++ branches/2.6/http/php/mod_meetingPoint.php	2009-09-30 08:14:47 UTC (rev 4765)
@@ -115,6 +115,7 @@
 var mod_meetingPoint_fix = "";
 
 
+
 function init_mod_meetingPoint(ind){
 	parent.mb_button[ind] = window.document.getElementById(mod_meetingPoint_button);
 	parent.mb_button[ind].img_over = mod_meetingPoint_img_over.src;
@@ -180,6 +181,9 @@
 
 
 function mod_meetingPoint_draw(){
+    var splitext  = document.forms[0].mytext.value;
+    document.forms[0].mytext.value = splitext.substring(0, meetingPoint_max_characters);
+    	
 	var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
 	if (mapObject) {
 		if (mod_meetingPointRealPoint !== null) {
@@ -211,6 +215,23 @@
 	}
 }
 
+/* Check max character value*/
+
+function checkMaxCharacters() {
+	var stringLength = document.forms[0].mytext.value.length;
+	if (stringLength > meetingPoint_max_characters) {
+		document.forms[0].mytext.value = document.forms[0].mytext.value.slice(0, meetingPoint_max_characters) ;
+		alert("meetingPoint_max_characters is set to " + meetingPoint_max_characters);
+	}
+}
+
+function setMaxCharacterTitle() {
+	var maxCharacterString = "Max characters: " + meetingPoint_max_characters;
+//	document.getElementById("mytext").title = maxCharacterString;
+	document.getElementById("mytext").setAttribute("title",maxCharacterString);
+//	document.forms[0].mytext.title = maxCharacterString;
+}
+
 /*
 function mod_meetingPoint_draw(){
 	var ind = parent.getMapObjIndexByName(mod_meetingPoint_target);
@@ -322,7 +343,7 @@
 </script>
 
 </head>
-<body>
+<body onload="setMaxCharacterTitle()">
 
 <form action="" >
 
@@ -337,7 +358,7 @@
 <input class='strinput' type="hidden" name='mypw' value='<?php  echo $_SESSION["mb_user_password"];  ?>'>
 <br>
 <!--<input class='strinput' type="textarea" size=2 name='mytext' value='' "maxlength=70" title="max. 70 Zeichen">-->
-<textarea class='strinput' rows="3" name='mytext' title='maximal 70 Zeichen'></textarea>
+<textarea class='strinput' rows="3" name='mytext' id='mytext' onmouseover='checkMaxCharacters()' title='' onkeyup='checkMaxCharacters()'></textarea>
 <br>
 <input class="okbutton" name="Send"   type="button" value="ok" onclick="validate();">
 <input class="ibutton" type="button" value="cancel" onClick="emptyfields();">



More information about the Mapbender_commits mailing list