Method One:
Add the following JavaScript code to the defined form:
{
Anchor: ' 95% ',
Xtype: ' Fileuploadfield ',
ID: ' Form-file ',
Emptytext: ' Please select ',
Fieldlabel: ' Upload attachments ',
Name: ' Meetingaffix ',
ButtonText: ' Browse '
}
After you click the browse button, you can open the dialog box, and when the file is selected, the selected file path appears in the text box after the upload attachment.
Method Two:
Add the following JavaScript code to the defined form:
{
Columnwidth:1,
Layout: ' Form ',
Bodystyle: ' padding:10px ',
DefaultType: ' TextField ',
LABELWIDTH:120,
width:1000,
Buttonalign: ' Center ',
Items: [{
Fieldlabel: ' Please select the file to upload ',
Name: ' FileName ',
ID: ' FileId ',
Anchor: ' 95% ',
Allowblank:false,
InputType: ' File '
} ]
}
Method Three:
Define the following JavaScript functions for the button:
var inputobj=document.createelement (' input ')
Inputobj.setattribute (' id ', ' _ef ');
Inputobj.setattribute (' type ', ' file ');
Inputobj.setattribute ("Style", ' Visibility:hidden ');
Document.body.appendChild (Inputobj);
Inputobj.click ();
Inputobj.value;
Clicking the button that has added a function pops up a dialog box that selects the local file.