[pLog-svn] r460 - plog/trunk/js/ui

subaochen at devel.plogworld.net subaochen at devel.plogworld.net
Fri Dec 10 02:39:03 GMT 2004


Author: subaochen
Date: 2004-12-10 02:39:01 +0000 (Fri, 10 Dec 2004)
New Revision: 460

Modified:
   plog/trunk/js/ui/forms.js
Log:
M$ IE now works


Modified: plog/trunk/js/ui/forms.js
===================================================================
--- plog/trunk/js/ui/forms.js	2004-12-09 16:12:07 UTC (rev 459)
+++ plog/trunk/js/ui/forms.js	2004-12-10 02:39:01 UTC (rev 460)
@@ -20,19 +20,26 @@
  else
    hideElement(elem); 
 }
-   
+
 function addElementToForm (containerName, fieldType, fieldName, fieldValue)
 {
-  if (document.getElementById) {
+var separator = document.getElementById('marker');
+var container = document.getElementById(containerName);
+if (navigator.userAgent.indexOf("MSIE") != -1){//isie
+var fileTag ="<input type='"+fieldType+"' value='' name='"+fieldName+"_"+numFields+"'>";
+var fileObj = document.createElement(fileTag); 
+var newLine = document.createElement('BR');
+container.insertBefore(fileObj,separator);
+container.insertBefore(newLine,separator);
+numFields++;
+}//endie
+  else
+	{//notie
+	  if (document.getElementById) {
     var input = document.createElement('INPUT');
     var newLine = document.createElement('BR');
     var newFieldName = fieldName + '_' + numFields;
     if( debug) window.alert('adding field ' + newFieldName);
-	
-    container = document.getElementById(containerName);
-    
-    separator = document.getElementById('marker');
-    
       if (document.all) { 
         input.type = fieldType;
         input.name = newFieldName;
@@ -48,6 +55,7 @@
     container.insertBefore(newLine,separator);
     numFields++;
   }
+	}//endnotie
 }
 
 function getField (form, fieldName) {




More information about the pLog-svn mailing list