(06-16-2011, 01:22 PM)netco Wrote: Hello,
is there anyway, that an uploaded document gets its filename automaticly when entering no specific name for it (and not uploading multiple files)?
Best regards,
netCo
I decide to do this feature by my own because it is much convenient )
You can simple use linked out.AddDocument.php from attachment.
The changes are:
Quote:<td><?php printMLText("name");?>:</td>and
<td><input name="name" size="60">
<input type="checkbox" id="nameused" name="nameused" disabled="disabled" checked="checked" value="1">
<a href="javascript:disableName()"><?php printMLtext("selection") ?></a>
</td>
Quote:function disableName()Add one line in addFiles function
{
if(document.getElementsByName("userfile[]").length==1){
if(document.form1.nameused.checked==true){
document.form1.nameused.checked=true;
document.form1.name.disabled=true;
}else{
document.form1.nameused.checked=false;
document.form1.name.disabled=false;
}
}
}
Quote:function addFiles()And change one line in the function checkform
{
document.getElementById("files").innerHTML += '<br><input type="File" name="userfile[]" size="60">';
document.form1.name.disabled=true;
document.form1.nameused.checked=false;
}
Quote://if (document.form1.userfile[].value == "") msg += "<?php printMLText("js_no_file");?>\n";The main concepts are
if(!document.form1.name.disabled){
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
}
1) to add checkbox to see if name field is used or not, default checkbox value checked,
2) to add link that will disable use of name field.
It is better to use new text varaible for link but it will need to make changes in all language files.
"Whatever you do, work at it with all your heart, as working for the Lord, not for human masters". Kol.3:23