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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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