How can I make certain upload fields required? How can I make certain upload fields required?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How can I make certain upload fields required?

Started by erroneus, July 13, 2004, 12:13:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

erroneus

When my users upload pictures, I want the title and description to be required fields. How can I do this? Thanks in advance.

erroneus


Joachim Müller

out-of-the-box, this is not possible, so you'll have to code some extra logic that does the checking and prompts the user to fill in the mandatory fields. Since the hack you're requesting is not that trivial, you can't expect people have a solution ready for copy'n paste. It's advisable that you code it using JavaScript if you're not sure about php, with the <form> field code changed to<form ...  onSubmit="return chkForm();" >and the JavaScript bit like this    function chkForm()
    {
     if(document.form_name.field_name.value == "")
      {
       alert("please enter something into 'foobar'");
       document.form_name.field_name.focus();
       return false;
      }


GauGau