I've added a form for my webpage that allows for multiple file uploads I input I tried to add a warning that appears only if the browser does not support multiple file features. I tried this code: But it always displays "Multiple_Warning" regardless how can I treat it properly? Check the console to see if your test always fails;) You can see this feature with this snippet & lt ; Input type = "file" name = "photo_upload []" id = "photo_upload" multiple = "multiple" /> .
& lt; Script type = "text / javascript" & gt; Var testrange = document.createElement ("input") testrange.setAttribute ("multiple", "multiple") (testrange.multiple == "multiple") {document.getElementById ('multiple_verning'). Style.display = 'none'; } & Lt; / Script & gt; & Lt; Div id = "multiple_warning" style = "background: #FFFF99; border: dashed; border width: thin;" & Gt; Sorry, but your browser does not support multiple file uploads feature. & Lt; Br / & gt; If you have more than one photo to send to us, please send it after receiving your compass email. & Lt; / Div & gt;
testrange.setAttribute ("multiple", "multiple") console.log (testrange.multiple);
if (! ("Multiple" in testrange)) {Warning ("no multiple uploads is not supported") ; }
Comments
Post a Comment