Advanced search  

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

Pages: [1]   Go Down

Author Topic: How can I make certain upload fields required?  (Read 3753 times)

0 Members and 1 Guest are viewing this topic.

erroneus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 58
How can I make certain upload fields required?
« 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.
« Last Edit: July 14, 2004, 08:26:15 pm by erroneus »
Logged

erroneus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 58
Re: How to make certain upload fields required
« Reply #1 on: July 14, 2004, 08:24:55 pm »

Anyone?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How can I make certain upload fields required?
« Reply #2 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
Code: [Select]
<form ...  onSubmit="return chkForm();" >and the JavaScript bit like this
Code: [Select]
    function chkForm()
    {
     if(document.form_name.field_name.value == "")
      {
       alert("please enter something into 'foobar'");
       document.form_name.field_name.focus();
       return false;
      }

GauGau
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.