[Cartoweb-users] Upload georeferenced images with Edition plugin

Igor Evdokimov igev at mail.ru
Mon Jun 25 10:02:06 EDT 2007


> There are plenty of tutorial on the web about file upload and  
> javascript popup handling,
> you shouldnt have much problem to do what you want.

Hi, Oliver and all CWlist Users!

I've found and modified "popup file upload window" script and it  
works (ajax_upload.php). Thanks!
But new problems arise.

After this popup window is closed, it returns "new filename" string
to one of input fields to the main window via this JS function in  
ajax_upload.php:

========================================
     <!--
     function pickName()
     {
         if (window.opener && !window.opener.closed)
              
window.opener.document.attachForm.attachFile.value=document.aForm.filena 
me.value;
         window.close();
     }
========================================

Problems:
1. In the main window the editable field with "image" string has  
dynamic and complex name
    like "edit_feature_" + aFeature.id + "[" + this.editAttributeNames 
[i] + "]", and
    I can't (for now) transfer it to popup window and to use there.  
So I've created
    additional string edit field below "image" field named  
"attachFile" to put
    there result string from "popup window". (So user must then copy  
it to main field by hand).
    It is not very comfortable, but I don't know how to do this better.
    Is it possible to set an alias to edit field?

2. The main problem - "image edit field" together with "attachFile  
field" and "Popup button"
    must be placed in "FORM" element (named "attachForm", see  
Map.prototype.editTableAddRow function).
    When I fill these fields and press button "Validate", JS returns  
an error (even if I comment all
    additional input fields):
    "Input has no properties, source http://imac.local/cartoweb/ 
htdocs/js/dhtmlInit.js, string 150"
    So I think this "FORM" element somehow prevents correct script  
execution. What is wrong?

3. Is it possible to use "textarea" element instead of "input" type  
for some fields?
    I see that dropdowns can be created from one recent topic.

Thank you for any help!

Best regards, Igor.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ajax_upload.php
Type: text/php
Size: 8498 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/cartoweb-users/attachments/20070625/68f02810/ajax_upload-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhtmlEdit.js
Type: text/javascript
Size: 21681 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/cartoweb-users/attachments/20070625/68f02810/dhtmlEdit-0001.bin


More information about the Cartoweb-users mailing list