Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: How to create select field?: Edit Log

Here is the list of edits for this post
How to create select field?
How to create a new column, which will result following Select form HTML code?:
Code:
<select name="test">
<option value="" selected>Please select a value</option>
<option value="(1) value1">(1) value1</option>
<option value="(2) value2">(2) value2</option>
<option value="(3) value3">(3) value3</option>
<option value="(4) value4">(4) value4</option>
</select>


The select form should have no default value selected or selected the "Please select a value" only.
The user must select a value so it should be NOT NULL, but should have no default value.

Currently the added 'test' column looks like this in the .def file:
Code:
'test' => {
'file_max_size' => '',
'file_save_in' => '',
'file_save_scheme' => 'HASHED',
'file_save_url' => '',
'form_display' => 'Test',
'form_names' => [
'(1) value1',
'(2) value2',
'(3) value3',
'(4) value4'
],
'form_size' => '',
'form_type' => 'SELECT',
'form_values' => [
'(1) value1',
'(2) value2',
'(3) value3',
'(4) value4'
],
'not_null' => '1',
'pos' => '8',
'regex' => '',
'type' => 'ENUM',
'values' => [
'(1) value1',
'(2) value2',
'(3) value3',
'(4) value4'
],
'weight' => ''
}


But the problem is, that <%Dbsql::HTML::generate_select('test')%> doesn't generate the awaited select HTML code. It always has a selected value, but should be not selected by default:
Code:
<select name="test">
<option value="(1) value1">(1) value1</option>
<option value="(2) value2">(2) value2</option>
<option value="(3) value3">(3) value3</option>
<option value="(4) value4">(4) value4</option>
</select>


Any ideas, how to setup the column, to have the correct select HTML code generated?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Apr 29, 2005, 4:32 PM

Edit Log: