Textbox Validation

QuestionsTextbox Validation
Anand asked 4 years ago

Hi Abu,

I tried to validate the text field to avoid alphabets, only allow to enter numeric and double values. How to do this?

Hope to get the reply as soon as possible.

Thank you.

5 Answers
Abu Ghufran answered 4 years ago

You can set with that column:

$col["editrules"] = array("number"=>true);

Anand answered 4 years ago

Hi Abu,

I tried this but its not working for me. its allow to enter characters.

Anand answered 4 years ago

Hi Abu,

Thanks for your response. When submit form Its working, but i need to use it on text field oninput or onchange.

Thank you,

Abu Ghufran answered 4 years ago

This is doable with onblur event.

$col = array();
$col["title"] = "Total";
..
$col["editoptions"] = array("onblur"=>"validate_onblur(this)");
$cols[] = $col;

and

function validate_onblur(o) { }

Source: http://www.phpgrid.org/demo/demos/editing/js-validation.phps

Your Answer

18 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?