Problem When edit with validation

QuestionsProblem When edit with validation
Sergio Pulido asked 6 years ago

316/5000

When I add a record, valid the order by ajax, to see if it already exists, the problem is that when editing, it also does the validation, and remains blocked in that field, because it already exists!
Can I turn off in edit mode?
$ col [“editoptions”] = array (“onblur” => “validate_onblur (this)”);

https://imgur.com/a/VKhB6yk

Greetings, Sergio Pulido.

2 Answers
Abu Ghufran Staff answered 6 years ago

I’ll be updating back after working.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 6 years ago

Hello,

Your ticket somehow got unanswered.

Solution for your case is to identify if the dialog is add or edit. If it is edit you can skip the ajax call.

To check the operation, you can verify the value of first column (PK or ID) using jquery selector. It will be empty for add and will have data for edit dialog.

E.g.

Add: https://i.imgur.com/L6VTFuR.png

Edit: https://i.imgur.com/XCSE8r3.png

Selector: https://i.imgur.com/S4Vwku1.png

if ( $(“[name=product_id].FormElement”).val() == “”)
{
// do ajax validation otherwise not.
}

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

2 + 20 =

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?