Alert message

edited May 2012 in Modules
I have textbox and i need to show alert message whenever user enters value greater then 100
for example in the field age if user enters value greater than 100 alert should pop up

function form_fields($values = array())
{
$fields = parent::form_fields();
$CI =& get_instance();
$CI->load->module_model(Example_FOLDER, 'example_to_permissions_model');
$CI->load->module_model(Example_FOLDER, 'example_to_users_model');
$fields['user']['label'] = 'username';
$fields['vAge']['label'] = 'Age';
$fields['height']['label'] = 'Height';

return $fields;
}

Comments

  • edited 6:46AM
    Thanks i got it, i used in save method is there any other way to give the alert??
  • edited 6:46AM
    Assuming this is in a module, have you tried using jQuery? Maybe something like:

    $("#target").keypress(function() { if ($(this).val() > 100) alert(); });

    Without any context, personally I'd leave the validation and notifications the 'FUEL' way for consistency with other messages.
Sign In or Register to comment.