[Chameleon] problem accessing HTML Hidden Variable
Jacob Delfos
jacob.delfos at maunsell.com
Thu Aug 4 20:01:23 EDT 2005
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20050805/4f27dc24/attachment-0001.html
More information about the Chameleon
mailing list