3.2.0

Strange Behaviour with Input Type set to File

Am I going mad!

This looks odd in IE and just wrong in Firefox.

var addButton = new AW.UI.Input;
addButton.getContent("box/text").setAttribute("type", "file");
addButton.getContent("box/text").setAttribute("cols", "0");
addButton.setControlText("Add Collection");

This is AW2 Standard by the way ?

Am I doing something wrong trying to get a File Input button to be displayed ?

For the record I am just trying to read a filename into a grid cell (which I think I know how to do - if I can get the Input type=file to work!
Yasdnil
February 12,
"cols" is not a valid attribute for a file type input field. The following is just about all you are going to be able to do with this type of field.

var addButton = new AW.UI.Input;
addButton.getContent("box/text").setAttribute("type", "file");
addButton.setStyle("width", "100%");
document.write(addButton);


You can change the "100%" to whatever dimension you want. But that's about it. This type of control is directly tied to the operating system, not the browser (IE, FF, etc.), and M$ wants to keep it that way.

Styles (for the most part) will not work. A change of image will not work. A change of the control text will not work. Populating the field via JavaScript and then submitting will definitely not work. The list goes on and on.
Mario
February 13,

This topic is archived.

See also:


Back to support forum