[Cartoweb-users] Problem with Checkboxes
Carolin Latze
carolin.latze at unifr.ch
Tue Sep 11 09:29:34 EDT 2007
Hi all,
I try to write a plugin, which executes depending on a checkbox
selection in the Navigation Tab. Therefore, I add to cartoclient.tpl:
{if $products_active|default:''}
<p><b>Show all Companies for a special Product</b></p>
Products:<br />
<input type="checkbox" id="prod1"
name="Brotgetreide"/>Brotgetreide<br />
<input type="checkbox" id="prod2" name="Butter"/>Butter<br />
<input type="checkbox" id="prod3" name="Eier"/>Eier<br />
<input type="checkbox" id="prod4" name="Milch"/>Milch<br />
{/if}
This works perfect. But now, if I try to read out, which checkbox is
activated, I use:
$this->p1 = isset($request[self::PROD1]) ?
$request[self::PROD1] : '';
$this->p2 = isset($request[self::PROD2]) ?
$request[self::PROD2] : '';
$this->p3 = isset($request[self::PROD3]) ?
$request[self::PROD3] : '';
$this->p4 = isset($request[self::PROD4]) ?
$request[self::PROD4] : '';
in the HttpHandlePostRequest method of the plugin. This leads to the
following error message:
Fatal error: Undefined class constant 'PROD1' in
C:\wamp\www\cartoweb3\projects\gis-lag\plugins\products\client\ClientProducts.php
on line 26
I think, I use the wrong method to read the checkboxes, but I cannot
find any example how to do it the right way. Does anybody have an idea?
Thanks in Advance
Carolin
--
Carolin Latze
Research Assistant
Department of Computer Science
Boulevard de Pérolles 90
CH-1700 Fribourg
phone: +41 26 300 83 30
More information about the Cartoweb-users
mailing list