- do not ask for a filename if _strictFormCheck is set to false

- do not erase file selection fields if a new document is added
This commit is contained in:
steinm 2011-07-20 10:27:38 +00:00
parent bb3ce66aaf
commit 8a754b5f63

View File

@ -51,12 +51,12 @@ function checkForm()
msg = ""; msg = "";
//if (document.form1.userfile[].value == "") msg += "<?php printMLText("js_no_file");?>\n"; //if (document.form1.userfile[].value == "") msg += "<?php printMLText("js_no_file");?>\n";
if(!document.form1.name.disabled){
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
}
<?php <?php
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) { if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
?> ?>
if(!document.form1.name.disabled){
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
}
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n"; if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
if (document.form1.keywords.value == "") msg += "<?php printMLText("js_no_keywords");?>\n"; if (document.form1.keywords.value == "") msg += "<?php printMLText("js_no_keywords");?>\n";
<?php <?php
@ -72,7 +72,10 @@ function checkForm()
function addFiles() function addFiles()
{ {
document.getElementById("files").innerHTML += '<br><input type="File" name="userfile[]" size="60">'; var li = document.createElement('li');
li.innerHTML = '<input type="File" name="userfile[]" size="60">';
document.getElementById('files').appendChild(li);
// document.getElementById("files").innerHTML += '<br><input type="File" name="userfile[]" size="60">';
document.form1.name.disabled=true; document.form1.name.disabled=true;
} }
@ -96,8 +99,8 @@ $docAccess = $folder->getApproversList();
</table><br> </table><br>
<form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();"> <form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
<input type="Hidden" name="folderid" value="<?php print $folderid; ?>"> <input type="hidden" name="folderid" value="<?php print $folderid; ?>">
<input type="Hidden" name="showtree" value="<?php echo showtree();?>"> <input type="hidden" name="showtree" value="<?php echo showtree();?>">
<table> <table>
<tr> <tr>
<td><?php printMLText("sequence");?>:</td> <td><?php printMLText("sequence");?>:</td>
@ -111,9 +114,9 @@ $docAccess = $folder->getApproversList();
<td><?php printMLText("local_file");?>:</td> <td><?php printMLText("local_file");?>:</td>
<td> <td>
<a href="javascript:addFiles()"><?php printMLtext("add_multiple_files") ?></a> <a href="javascript:addFiles()"><?php printMLtext("add_multiple_files") ?></a>
<div id="files"> <ol id="files">
<input type="File" name="userfile[]" size="60"> <li><input type="File" name="userfile[]" size="60"></li>
</div> </ol>
</td> </td>
</tr> </tr>
<tr> <tr>