[Chameleon] problem accessing HTML Hidden Variable
    Jan Jansen 
    jansen at nieuwland.nl
       
    Fri Aug  5 04:43:14 EDT 2005
    
    
  
Hi Jacob,
disregard my last message, iIworked it out already. I made a mistake: I had 2 Hidden's with the same name in my template, then chameleon doesn't recognize any of them... (a bit strange, but problem solved :)
Best 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/392d9b93/attachment.html
    
    
More information about the Chameleon
mailing list