For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2006 > funny behaviour of the static element









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author funny behaviour of the static element
Bjoern Mittelsdorf

2006-08-23, 6:58 pm

Hi everybody,

while trying to corrupt quickform, I noticed some funny behaviour of
static elements:

I wanted a static element in the form table but wanted its text to span
the whole width, so i tried:

$newform->addElement( 'static', "Hilfe", "Blabla", array( 'colspan' =>
'2') ) ;

Output:

-------+-----------+
Blabla | array |
-------+-----------+
Gender | textfield |
-------+-----------+

I do not understand, but I got a solution to my problem, like this :)

$newform->addElement( 'static', "Hilfe", "", "Blabla" ) ;

-------+-----------+
| Blabla |
-------+-----------+
Gender | textfield |
-------+-----------+

Is this a bug, is this intented, have I found the entrance to lost
worlds, and does this mean that I can add no attributes to a static
element ?

Thanks for your attention (sorry for my bad English),

Bjoern.
Mark Wiesemann

2006-08-23, 6:58 pm

Bjoern Mittelsdorf wrote:
> while trying to corrupt quickform, I noticed some funny behaviour of
> static elements:
>
> I wanted a static element in the form table but wanted its text to span
> the whole width, so i tried:
>
> $newform->addElement( 'static', "Hilfe", "Blabla", array( 'colspan' =>
> '2') ) ;


It seems that you haven't looked at this page?
http://pear.php.net/manual/en/packa...form-static.php

> Output:
>
> -------+-----------+
> Blabla | array |


Your array was converted to a string, which results in the string
'Array'.

> I do not understand, but I got a solution to my problem, like this :)
>
> $newform->addElement( 'static', "Hilfe", "", "Blabla" ) ;


See my link, you will understand it then. Maybe you also want to have a
look at the 'html' QF element if you to have the text really span about
both columns.

Regards,
Mark
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com