Examples for form field elements

Discuss MySQL Ajax Table Editor

Examples for form field elements

Postby raymundo47 » Tue Jan 27, 2009 10:07 pm

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!
raymundo47
 
Posts: 3
Joined: Tue Jan 27, 2009 9:58 pm

Re: Examples for form field elements

Postby admin » Wed Jan 28, 2009 3:26 pm

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;"');
admin
Site Admin
 
Posts: 1489
Joined: Fri Jul 11, 2008 1:34 am

Re: Examples for form field elements

Postby raymundo47 » Wed Jan 28, 2009 7:32 pm

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
raymundo47
 
Posts: 3
Joined: Tue Jan 27, 2009 9:58 pm

Re: Examples for form field elements

Postby admin » Wed Jan 28, 2009 8:08 pm

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;"');
admin
Site Admin
 
Posts: 1489
Joined: Fri Jul 11, 2008 1:34 am

Re: Examples for form field elements

Postby raymundo47 » Wed Jan 28, 2009 9:10 pm

Works Great! Again thanks for your quick and accurate responses!

Ray
raymundo47
 
Posts: 3
Joined: Tue Jan 27, 2009 9:58 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron