Brent
|
| Posted: 02/26/2002, 2:30 PM |
|
I have a search form (PHP) that has a ListBox that is filled from a Lookup SQL
statement. I also have Custom Initial value checked and Default Value is "All"
and the Submit Value is blank. The listbox is filled correctly with the
values from the SQL and it also has the "All" item in it. The problem is when the
search form first appears the listbox should have "All" as the default value.
Instead it has one of the values from the SQL (whose submit value is 0) instead of the
initial value of "All".
Is there a way to get it to default to "All"? TIA
|
|
|
 |
Alex Alexapolsky
|
| Posted: 02/27/2002, 2:43 AM |
|
What is our CC version ?
What template do you use in Properties/Language ?
|
|
|
 |
Brent
|
| Posted: 02/27/2002, 7:02 AM |
|
I'm using PHP 4 & Templates with CC 2.04.
|
|
|
 |
Brent
|
| Posted: 02/27/2002, 2:26 PM |
|
I wrote another search form and had to create a custom SQL on a listbox and
defined a default value whose submit value is a blank. The same thing happens.
The listbox refuses to display the default value and instead displays the
display value associated with the submit value of "0".
It apparently is translating the "?security_level=&" into 0 instead of recognizing
the value is missing and using the display value associated with "" instead.
Example:
The search form has a "Security Level" field that has SQL to pull in the
security level of 0;none,1;registered;2;editor;3;admin from a table.
(Yes I know I can hard code this but the levels may change). The Display
Custom value is "All;" for the Display Value and Submit Value. So by selecting
All it should search on all security levels.
When the form displays, the combo box is set to "none" instead of "All". I also
noticed if I set it back to "All" and do a search, the grid displays all rows
but the listbox gets set back to "none". The URL has "?s_security_level=&".
If I change the row in the table from "0,None" to "-1,None" then the listbox
displays the default value correctly (empty). So it has to do with the row
value being 0, and this overrides the default listbox value.
|
|
|
 |
|