Page 1 of 1

Examples for form field elements

PostPosted: Tue Jan 27, 2009 10:07 pm
by raymundo47
Hi, do you have any better examples showing how to set different form field elements?

In your documentation you show:

textarea - Use a textarea.
'textarea' => array('rows' => 5, 'cols' => 30)

col_header_info - Set html attributes or css styles to go in the column header.
'col_header_info' => 'width="150" style="border: 1px solid #333;"'

input_info - html attribute hash that will be added to the input, select or textarea tags on add and edit.


I am particularly interested in textareas, width etc. Your example files don't seem to show any example uses for this. I tried adding these like this: $tableColumns['edu_text'] = 'textarea' => array('rows' => 5, 'cols' => 30); but gives a parsing error.

Thanks in advance!

Re: Examples for form field elements

PostPosted: Wed Jan 28, 2009 3:26 pm
by admin
Try changing
Code: Select all
$tableColumns['edu_text'] = 'textarea' => array('rows' => 5, 'cols' => 30);


to

Code: Select all
$tableColumns['edu_text'] = array('display_text' => 'Edu Text', 'perms' => 'EVCS', 'textarea' => array('rows' => 5, 'cols' => 30));


You could also set a width with css using the input info option

Code: Select all
$tableColumns['edu_text'] = array('display_text' => 'Edu Text', 'perms' => 'EVCS', 'textarea' => array('rows' => 5, 'cols' => 30), 'input_info' => 'style="width: 500px;"');

Re: Examples for form field elements

PostPosted: Wed Jan 28, 2009 7:32 pm
by raymundo47
First thanks for the prompt reply! Great service for a great product!

The textarea worked great but I still can't get form input field widths to work. I am trying:

$tableColumns['mid_init'] = array('display_text' => 'MI', 'perms' => 'EVCAXQS','input_info' => 'width="5"');

I saw not examples for this and if you do and I missed it let me apologize now.

Thanks in advance.

Ray

Re: Examples for form field elements

PostPosted: Wed Jan 28, 2009 8:08 pm
by admin
You need to change
Code: Select all
$tableColumns['mid_init'] = array('display_text' => 'MI', 'perms' => 'EVCAXQS','input_info' => 'width="5"');

to
Code: Select all
$tableColumns['mid_init'] = array('display_text' => 'MI', 'perms' => 'EVCAXQS','input_info' => 'size="5"');

or you could use css
Code: Select all
$tableColumns['mid_init'] = array('display_text' => 'MI', 'perms' => 'EVCAXQS','input_info' => 'style="width: 150px;"');

Re: Examples for form field elements

PostPosted: Wed Jan 28, 2009 9:10 pm
by raymundo47
Works Great! Again thanks for your quick and accurate responses!

Ray