Problem When edit with validation

QuestionsProblem When edit with validation
Sergio Pulido asked 3 months 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 3 months ago

I’ll be updating back after working.

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Abu Ghufran Staff answered 1 month 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
PHP Grid Framework
 
Your Answer

19 + 1 =

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 / 5. Vote count:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!