coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: erroneus on July 13, 2004, 12:13:24 AM

Title: How can I make certain upload fields required?
Post by: erroneus on July 13, 2004, 12:13:24 AM
When my users upload pictures, I want the title and description to be required fields. How can I do this? Thanks in advance.
Title: Re: How to make certain upload fields required
Post by: erroneus on July 14, 2004, 08:24:55 PM
Anyone?
Title: Re: How can I make certain upload fields required?
Post by: Joachim Müller on July 15, 2004, 04:30:20 PM
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