Login Retreive lost passwordRegister
Search

Forum Index / General / Bug in ListField ??

[ This topic is solved ]

  Sebastian Buse 17 June 10 / 16:47  
Changed at 17 June 10 / 16:47
Hello

please check the ListField function.

This use Array Keys as value
$form->ListField("Funktionen", "configuration_v1", createListfieldarray());

and this use the value as value. But for $useArrayKeyAsValue nothing works. (true false, 0, 1, FH_DEFUALT_USEARRAYKEY)

$form->ListField("Funktionen", "configuration_v1", createListfieldarray(),"","","","10");

Sebastian

  Johan Wiegel (Admin) 17 June 10 / 21:32  
The test script I use indicates true and false for $useArrayKeyAsValue.

how ever it should be the fourth argument. There was a fault in the manual, the validator argument was missing there.

<?php

// the values for the listfield
$values = array(
  
=> "PHP",
  
=> "MySQL database",
  
=> "Frontpage extensions",
  
=> "ASP",
  
=> "10 MB extra webspace",
  
=> "Webmail",
  
=> "Cronjobs"
);

// include the class
include("includes/FH3/class.dbFormHandler.php");

// new $form object
$form = new FormHandler();

// the listfield
$form->ListField("Products""products"$values);
$form->ListField("Products""products2"$values,null,false);

// buttons beneath it
$form->SubmitButton("Save");

// set the 'commit after form' function
$form->OnCorrect("doRun");

// flush the form
$form->Flush();

// function to show the selected items
function doRun$aData )
{
    
print_r$aData );

?>

  Sebastian Buse 30 June 10 / 14:06  
Thank you !!!
Sebastian

  Top


powered by PHP-GLOBE   © 2004 - 2010 FormHandler. All rights reserved.   -   Open source license