|
|
|
 |
 |
 |
|
[ 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(
1 => "PHP",
2 => "MySQL database",
3 => "Frontpage extensions",
4 => "ASP",
5 => "10 MB extra webspace",
6 => "Webmail",
7 => "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 );
}
?>
|
|
|
|
|
|
|