Login Retreive lost passwordRegister
Search

Forum Index / General / viewmode()

[ This topic is solved ]

  Vincent Kleijnendorst 07 March 06 / 23:22  
Hi,

The function viewmode() currently shows the values of a field only.
Would it be possible to extend that to also use labels?

A grid of checkboxes currently looks like this in viewmode:

- 1
- 2
- 3

Where it would be more logical when it reads:

- Group 1
- Group 2
- Group 3

Thus, the array values (that's the same you see when you see the checkboxes when not in viewmode)

  Teye Heimans (Founder) 08 March 06 / 15:38  
Could you post some code where it goed wrong?

  Vincent Kleijnendorst 08 March 06 / 15:44  
It's not really wrong.
When you have multiple checkboxes like this:

<?php
$animals 
= array('dg' => 'dog''ct' => 'cat');

$form->checkBox("Favorite animal(s)""animal"$animals);

?>


A normal form then shows checkboxes with labels. (so you don't see the actual values). When you show a form in viewmode(), you'll see a list with the values:

- dg
- ct

It would be more logical for the user to see the labels instead of the values.

Cheers.

  Teye Heimans (Founder) 08 March 06 / 16:13  
Could it be that you are still using an older version of FormHandler?

When I use this:
<?php

$animals 
= array('dg' => 'dog''ct' => 'cat');

$form->checkBox("Favorite animal(s)""animal"$animals);

$form -> setValue('animal''dg, ct');

$form -> setFieldViewMode('animal');

?>


I get to see:
* dog
* cat

  Vincent Kleijnendorst 08 March 06 / 16:48  
whoops, that could be.
A was using viewmode() for the whole form.

Let's see I if can update without problems. :)

  Teye Heimans (Founder) 09 March 06 / 10:37  
If you use enableViewMode, the effect is the same on the fields...

  Top


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