⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

how to input data uppercase



siarik
  • profile picture
  • Member

Posted 11 July 2012 - 04:46 AM

how to input data uppercase or lowercase in form input grocery crud ?

thx

siarik
  • profile picture
  • Member

Posted 11 July 2012 - 08:13 AM

how to input data[b] UPPERCASE[/b] or [b]Capitalized Cas[/b]e in form input grocery crud ?

Anto
  • profile picture
  • Member

Posted 11 July 2012 - 08:34 AM

kamsudnya pas kita ketik otomatis jadi huruf gede ya gan ?

Anto
  • profile picture
  • Member

Posted 11 July 2012 - 08:40 AM

i have a similar question about this, when we type at the input box .In grocerycrud how do we make the letter that we type automatically become uppercase or capitalized ?
normally we could use javascript . but at grocerycrud i have no idea how to do that

fdias
  • profile picture
  • Member

Posted 11 July 2012 - 17:27 PM

I would use CSS to do that.

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!

Anto
  • profile picture
  • Member

Posted 12 July 2012 - 01:44 AM

thanks for the reply fdias,
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

Anto
  • profile picture
  • Member

Posted 12 July 2012 - 03:00 AM

solved the problem , apperently i missed this <!DOCTYPE html> , so my textbox height size was halfed :P

siarik
  • profile picture
  • Member

Posted 12 July 2012 - 06:07 AM

saya bingung gan, mohon diperjelas donk caranya thx :)

fdias
  • profile picture
  • Member

Posted 13 July 2012 - 17:22 PM

[size=3][font=arial,helvetica,sans-serif]@Anto that's why I suggested the use of a callback function, this way you can change the input.[/font][/size]

[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]

$crud->callback_add_field('fieldname',array($this,'callback_to_upper'));
[/font][/size]

[size=3][font=arial,helvetica,sans-serif]Callback function:[/font][/size]

[size=3][font=arial,helvetica,sans-serif]

function callback_to_upper()
{
return '<input type="text" name="fieldname" style="text-transform:uppercase;">';
}
[/font][/size]

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]

$crud->callback_add_field('fieldname',array($this,'callback_to_lower'));
[/font][/size]

[size=3][font=arial,helvetica,sans-serif]Callback function:[/font][/size]

[size=3][font=arial,helvetica,sans-serif]

function callback_to_lower()
{
return '<input type="text" name="fieldname" style="text-transform:lowercase;">';
}
[/font][/size]

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]

$crud->callback_add_field('fieldname',array($this,'callback_to_cap'));
[/font][/size]

[size=3][font=arial,helvetica,sans-serif]Callback function:[/font][/size]

[size=3][font=arial,helvetica,sans-serif]

function callback_to_cap()
{
return '<input type="text" name="fieldname" style="text-transform:capitalize;">';
}
[/font][/size]

siarik
  • profile picture
  • Member

Posted 17 July 2012 - 03:01 AM

thx mr fdias and mr anto. my problem is solved thx very much..

gudjohnson
  • profile picture
  • Member

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


siarik
  • profile picture
  • Member

Posted 23 April 2013 - 05:45 AM

i have  same problems too.

 

help mr fdias, for that problem

 

thanks