From: David <da...@df...> - 2004-05-24 07:17:56
|
Can you test this with a recent version (svn)? A lot of work has been done in this area. (and iirc this should work now) - david On Sun, 23 May 2004 13:56:21 +0200 "Raoul Pierre" <pie...@wa...> wrote: > Hello, > > I'm testing the Formsess from Formsess-Trunck.tgz (23-01-04). > > When I try the input tag with type checkbox, and I use array as name, > the values given in assign instruction are not used to generate > checked attributs. Example : > > $_fs->assign('cb1', array(1,2), true); > $_fs->assign('cb2', array('one'=>1,'tree'=>3), true); > > with > > <fs:input type="checkbox" name="cb1[]" value="1" /> > <fs:input type="checkbox" name="cb2[tree]" value="3" /> > > and no checked tag... > > When I look at smarty_function_fs_input_checkbox, there is: > > if (isset($params['cb_offset'])) { > // cb_offset: the getname is the name without the offset within > the > brackets at the end > //we don't need that atm, because getValue needs the [] > //$getname = substr($name, 0, (strlen($name) - 2 - > strlen($params['cb_offset']))); > $cb_offset = $params['cb_offset']; > unset($params['cb_offset']); > } > > //not need atm, see above > //if (!isset($getname)) { > // $getname = $name; > // > > //must be changed later, to use $getname instead of name > $item_value = $fs->getValue($name); > > so... > > But I don't understand why it's not possible to do it now. With: > > if (isset($params['cb_offset'])) { > // cb_offset: the getname is the name without the offset within > the > brackets at the end > //we don't need that atm, because getValue needs the [] > // !? getValue doesn't work with "[...]" > $cb_offset = $params['cb_offset']; > $getname = substr($name, 0, (strlen($name) - 2 - > strlen($cb_offset))); unset($params['cb_offset']); > } > else{ > $getname = $name; > } > $item_value = $fs->getValue($getname); > > > it seems OK. > > > Regards > > Pierre > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Formsess-devel mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formsess-devel > |