Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Quickform select freeze problem
There's a strange behaviout in freezing select elements in QF.
I want an empty (zero) value in the top of array I use for select
fields, to display a nice label (e.g, "choose one").
I don't put it directly in the array since I need to validate
(server-side) choosen option against the array (via a simple registerrule)
But... when I freeze the form, I don't get the choosen option!
Instead, I get the "choose" option (I understand it sound a bit
confusing, it's simpler to try than to explain)

Example code:


<?php
require_once 'HTML/QuickForm.php';
$arr = array('a' => 'this is a', 'b' => 'this b', 'c' => 'this c');
$form =& new HTML_QuickForm('mytest');
$form->addElement('text', 'mytext', 'text');
$form->addElement('select', 'mysel', 'abc', array('choose') + $arr);
$form->addElement('submit', 'ok', 'OK');
if ($form->validate()) {
$form->freeze();
$form->removeElement('ok');
}
echo $form->toHtml();
?>

Tried to look into QF source code, but no success.
Am I missing something?
TIA

--
Massimiliano Arione
:: http://www.garak.it/ ::
* NO WORD * http://gnu.org/philosophy/no-word-attachments.html
* NO HTML * http://efn.no/html-bad.html

Report this thread to moderator Post Follow-up to this message
Old Post
Massimiliano Arione
05-27-05 01:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:28 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.