Input file in menu

Hi, I want to put in menu a to select a file to load. I have this code;

toolbar.xml

<?xml version="1.0"?>
<toolbar>
	<item id="newContact" type="button" text="Aggiungi" img="add_contact.gif" imgdis="add_contact_dis.gif"/>
	<item id="delContact" type="button" text="Delete" img="delete_contact.gif" imgdis="delete_contact_dis.gif"/>
	<item id="sep01" type="separator"/>         
	<item id="openFolder" type="button" text="Apri archivio" img="open_folder.png" imgdis="open_folder.png"/>
	<item id="sep02" type="separator"/>         
	<item id="help" type="button" text="Help"/>
</toolbar>

index.html

           toolbar.attachEvent("onclick",function(id){                             
        	if(id=="openFolder"){
																				    // Code here
           };

Thanks for your help

Hi
You can try the next code sample:

[code]

Integration with dhtmlxAccordion html,body { width: 100%; height: 100%; margin-top: 10px; } .dhxform_obj_dhx_skyblue .dhxform_textarea { border: none !important; } .dhxform_obj_dhx_skyblue div.dhxform_item_label_left { padding-top: 0; } .dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_label { padding: 0; }
[/code]

Plus you just need to correct form’s CSS a little

Thanks, now I have problem with css. I’d like to have only one button and a image on left (“Apri archivio” button is an example), like the other toolbar’s buttons.

The link of the demo is:

dentalopen.altervista.org/

If your case will be more easier to use the next implementation:

[code]myToolbar = new dhtmlXToolbarObject({
parent: “toolbarObj”,
icons_path: “…/common/imgs/”
});
myToolbar.addButton(“upload”, 0, “Upload file”);
formData = [
{type: “fieldset”, label: “Uploader”, list:[
{
type: “upload”,
name: “myFiles”,
autoStart: true,
inputWidth: 330,
url: “…/dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php”,
_swfLogs: “enabled”,
swfPath: “uploader.swf”,
swfUrl: “…/dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php”}
]}
];
myForm = new dhtmlXForm(“formObject”, formData);

		myToolbar.attachEvent("onClick", function(id){
			if(id=="upload"){
				document.getElementsByClassName("button_browse")[0].click();
			}
		})
		myForm.attachEvent("onUploadComplete",function(count){
			alert("file is loaded")
		});[/code]

Thank you very much. But I’ve problem using this implementation. Could you modify my index.html because I tried but It doesn’t work.

Could you attach a demo, please? We wil fix it, test it and send you back.
docs.dhtmlx.com/auxiliary_docs__ … pport.html
It is quite complicated to fix your index without checking

Sorry, but what exactly problems do you have with our suggested one?

Here my demo. I can’t explain the error. I didn’t understand how to use the formData,

formData = [
            {type: "fieldset", label: "Uploader", list:[
               {
                  type: "upload",
                  name: "myFiles",
                  autoStart: true,
                  inputWidth: 330,
                  url: "../dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php",
                  _swfLogs: "enabled",
                  swfPath: "uploader.swf",
                  swfUrl: "../dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php"}
				]}
			];

what is formObject tag,

myForm = new dhtmlXForm("formObject", formData);

and what the next part of code does:

         toolbar.attachEvent("onClick", function(id){
				if(id=="upload"){
				   document.getElementsByClassName("button_browse")[0].click();
				}
			})

Thanks
my_demo.rar (730 KB)

Changed your demo a little
Check the attachment
my_demo_updated.rar (733 KB)

Thanks a lot… Now it’s ok.

You are welcome!