how to input data uppercase
- Single Page
Posted 11 July 2012 - 04:46 AM
thx
Posted 11 July 2012 - 08:13 AM
Posted 11 July 2012 - 08:34 AM
Posted 11 July 2012 - 08:40 AM
normally we could use javascript . but at grocerycrud i have no idea how to do that
Posted 11 July 2012 - 17:27 PM
If you want uppercase then use this code (remember you can use a callback_add_field and/or callback_edit_field to replace the input with this):
Uppercase:
<input type="text" name="fieldname" style="text-transform:uppercase;">
Lowercase:
<input type="text" name="fieldname" style="text-transform:lowercase;">
Capitalize:
<input type="text" name="fieldname" style="text-transform:capitalize;">
Hope it helps!
Posted 12 July 2012 - 01:44 AM
but in grocerycrud we don't make those <input > right?
as far as i know it's autogenerate from our db ,or is there a way that we could make it our own <input> in grocerycrud?
and i have a difficulty to adjust the input text height, i just don't know where the css is
i'm sorry for my bad english
Posted 12 July 2012 - 03:00 AM
Posted 12 July 2012 - 06:07 AM
Posted 13 July 2012 - 17:22 PM
[size=3][font=arial,helvetica,sans-serif]Check the examples below and you will see what I mean.[/font][/size]
TO UPPERCASE:
[size=3][font=arial,helvetica,sans-serif]On the crud method you use before render:[/font][/size]
[size=3][font=arial,helvetica,sans-serif]
[/font][/size]
$crud->callback_add_field('fieldname',array($this,'callback_to_upper'));
[size=3][font=arial,helvetica,sans-serif]Callback function:[/font][/size]
[size=3][font=arial,helvetica,sans-serif]
[/font][/size]
function callback_to_upper()
{
return '<input type="text" name="fieldname" style="text-transform:uppercase;">';
}
TO LOWERCASE:
[size=3][font=arial,helvetica,sans-serif]On the crud method you use before render:[/font][/size]
[size=3][font=arial,helvetica,sans-serif]
[/font][/size]
$crud->callback_add_field('fieldname',array($this,'callback_to_lower'));
[size=3][font=arial,helvetica,sans-serif]Callback function:[/font][/size]
[size=3][font=arial,helvetica,sans-serif]
[/font][/size]
function callback_to_lower()
{
return '<input type="text" name="fieldname" style="text-transform:lowercase;">';
}
TO CAPITALIZE:
[size=3][font=arial,helvetica,sans-serif]On the crud method you use before render:[/font][/size]
[size=3][font=arial,helvetica,sans-serif]
[/font][/size]
$crud->callback_add_field('fieldname',array($this,'callback_to_cap'));
[size=3][font=arial,helvetica,sans-serif]Callback function:[/font][/size]
[size=3][font=arial,helvetica,sans-serif]
[/font][/size]
function callback_to_cap()
{
return '<input type="text" name="fieldname" style="text-transform:capitalize;">';
}
Posted 17 July 2012 - 03:01 AM
Posted 18 March 2013 - 17:41 PM
seems to work fine when typed in the textbox, but when we look at the list, it is look wrong, so it is stored in the database is a capital letter.
example for lowercase:
when we type in the email textbox:
email: INFO@somedomain.com,
appears in the email textbox:
email: info@somedomain.com
when we press the Save or Save and go back to list button, it is stored in the database:
INFO@somedomain.com
please help for this problem. Thank's
Posted 23 April 2013 - 05:45 AM
i have same problems too.
help mr fdias, for that problem
thanks