0
Welcome Guest! Login
0 items Join Now

help needed with getting unchecked checkbox to work

  • help needed with getting unchecked checkbox to work

    Posted 17 years 9 months ago
    • Hi all,

      I've added a checkbox field to the submission page in remository and am wondering if somebody could help me getting it to work?

      in remositoryAddFileHTML.php I've added:
      $this->tickBoxField($file, 'cep', _CEP);
      in remositoryFileInfoHTML.php I've added:
      if ($file->cep==1) {
           echo "<a href='http://www.modthesims2.com/showthread.php?t=92541'>CEP required</a>";
      }

      only I'm running into an issue:

      when I untick the checkbox again the browser is not sending any information and the db is not being updated. thus how can I make something like a zero value being sent? and where would I need to put the code?

      would be totally cool if somebody could help me out!
    • Last Edit: 17 years 9 months ago by chrissy6930.
  • Re: help needed with getting unchecked checkbox to work

    Posted 17 years 9 months ago
    • ahhh I think I found the solution:

      in p-classes/remositoryFile.php I do now have:
      /** @var bool Is CEP required for this file? */
      var $cep='';
      function forceBools () {
           if ($this->cep) $this->cep=1;
           else $this->cep=0;
      }
      function addPostData ($adminside=false) {
           // Clear all tick boxes - will be sent by POST data if and only if tick is present
           $this->cep= 0;
      }
    • Last Edit: 17 years 9 months ago by chrissy6930.

Time to create page: 0.162 seconds