Commit d26f50d0 authored by Gabriel Monnerat's avatar Gabriel Monnerat

don't allow submit the field with upload field in blank

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45276 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 16a5abe9
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<div id="upload_document" title="Upload Document" i18n:translate="" i18n:domain="ui">\n <div id="upload_document" title="Upload Document" i18n:translate="" i18n:domain="ui">\n
<form action="WebSection_uploadDocument" method="post" enctype="multipart/form-data">\n <form action="WebSection_uploadDocument" method="post" enctype="multipart/form-data">\n
<fieldset id="file_box">\n <fieldset id="file_box">\n
<input type="file" size="30" name="file">\n <input id="upload-file" type="file" size="30" name="file">\n
<select name="portal_type">\n <select name="portal_type">\n
<option value="Web Page" i18n:translate="" i18n:domain="ui">Web Page</option>\n <option value="Web Page" i18n:translate="" i18n:domain="ui">Web Page</option>\n
<option value="Web Illustration" i18n:translate="" i18n:domain="ui">Web Illustration</option>\n <option value="Web Illustration" i18n:translate="" i18n:domain="ui">Web Illustration</option>\n
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
</select>\n </select>\n
<br />\n <br />\n
<input type="submit" id="submit_document" value="Submit" i18n:translate="" i18n:domain="ui">\n <input type="submit" id="submit_document" value="Submit" i18n:translate="" i18n:domain="ui">\n
<span id="no-input-file">Please input a file</span>\n
</fieldset>\n </fieldset>\n
</form> \n </form> \n
</div>\n </div>\n
......
...@@ -474,7 +474,13 @@ $().ready(function(){\n ...@@ -474,7 +474,13 @@ $().ready(function(){\n
}\n }\n
$("div#preference_dialog").dialog("open");\n $("div#preference_dialog").dialog("open");\n
});\n });\n
$("button.ui-button, span.ui-icon").click(function(){$("p#hide_properties").click()});\n $("button.ui-button, span.ui-icon").click(function(){$("p#hide_properties").click()}); \n
$("input#submit_document").click(function(event){\n
if (document.getElementById("upload-file").value == ""){\n
event.preventDefault();\n
$("span#no-input-file").show();\n
}\n
});\n
$("a[name=\'document_title\']")\n $("a[name=\'document_title\']")\n
.click(function(){\n .click(function(){\n
$("div#more_property").hide();\n $("div#more_property").hide();\n
......
345 346
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment