[Chameleon] problem accessing HTML Hidden Variable

Jan Jansen jansen at nieuwland.nl
Fri Aug 5 04:10:47 EDT 2005


Thanks Jacob, 

I made a mistake with that line, (I put it in to fast, first I just hardcoded the Hidden variable in my template, and the javascript check worked) in but fixing it doesn't fix my problem. . When I look in the source code, it looks ok, i have a hidden 'CUR_PPC' but still can't access it with 

       if ($this->isVarSet( "CUR_PPC" ))
   {
            $CURPPC = $this->getVar( "CUR_PPC" );

The rest of the code works, when I just set the var $CURPPC with a value, it runs ok.
Am i forgetting another thing to make sure Chameleon processes all 'my' hidden vars?

Regards, Jan


  ----- Original Message ----- 
  From: Jacob Delfos 
  To: chameleon at lists.maptools.org 
  Sent: Friday, August 05, 2005 2:01 AM
  Subject: RE: [Chameleon] problem accessing HTML Hidden Variable


  Hi Jan,

  This line:

  $szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable VALUE=\"\">";

  should be

  $szValue = " <INPUT TYPE=HIDDEN NAME='".$szVariable."' VALUE=\"\">";

  You actually included the variable reference as part of the string. So $szVariable would not have been picked up as a variable name. Probably if you check the source code of the page, you could see it being written out as $szVariable. I also put some quotes.

  regards,

  Jacob



  --------------------------------------------------------------------------------
  From: chameleon-bounces at lists.maptools.org [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Jan Jansen
  Sent: 5 August 2005 00:05
  To: chameleon at lists.maptools.org
  Subject: [Chameleon] problem accessing HTML Hidden Variable


  Hello list,

  I have a problem accessing an HTML hidden variable in my wigdet. Please can anyone tell me what I am missing here?

  I include the custom Hidden variable as follows (this all works fine):


   function GetHTMLHiddenVariables()
      {
        // parent::GetHTMLHiddenVariables();

          $szVariable = "CUR_PPC";
          $szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable VALUE=\"\">";
          $aReturn[$szVariable] = $szValue;
          return $aReturn;
      }

  *****

  a javascript function on my template fills the hidden var with a value (this all works fine):

  ******

   /**
       * get the javascript functions for this widget
       */
      function GetJavascriptFunctions()
      {
          $aReturn = array();
          $szJsFunctionName = "zoom24ppc";
          $szFunction = <<<EOT
  /**
   * {$szJsFunctionName}
   * called when the ppc value is set.
   */
  function {$szJsFunctionName}(obj)
  {
      
   {$this->mszHTMLForm}.CUR_PPC.value = obj; 
   //alert({$this->mszHTMLForm}.CUR_PPC.value);
     {$this->mszHTMLForm}.submit();
          
      return;
  }
  EOT;
          $aReturn[$szJsFunctionName] = $szFunction;

          return $aReturn;
      }

  ******

  But when I try to access the variable in ParseUrl function, it fails to read out the value:

  ******
    function ParseURL()
     {
      // Check if HIDDEN input is set 

          $szVariable = "CUR_PPC";
         if ($this->isVarSet($szVariable))
     {
              $CURPPC = $this->getVar( "CUR_PPC" );

  etc, etc.. What am I forgetting here? Any help would be highly appreciated

  regards, 

  Jan



------------------------------------------------------------------------------


  _______________________________________________
  Chameleon mailing list
  Chameleon at lists.maptools.org
  http://lists.maptools.org/mailman/listinfo/chameleon



------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Anti-Virus.
  Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20050805/600b3b4c/attachment.html


More information about the Chameleon mailing list