Advanced search  

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]

Pages: [1]   Go Down

Author Topic: How can I make certain upload fields required?  (Read 3644 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.018 seconds with 15 queries.