CONFIRMATION MESSAGE YES/NO VALIDATING THE VALUE OF A FIELD OF THE FORM

QuestionsCONFIRMATION MESSAGE YES/NO VALIDATING THE VALUE OF A FIELD OF THE FORM
Adrian asked 2 years ago

Good afternoon

I have the following problem. When I add a record I have to validate if the value of a form field is true and display an accept or cancel message. If you accept, save the record, otherwise cancel the operation. The example I found in the forum doesn’t work for me because I don’t have the validation of the field of the form I’m sending. Thank you very much for the help. Adrian

4 Answers
Abu Ghufran Staff answered 2 years ago

Hello,

I’m unable to understand your question completely.

Please share related code and screencast / screenshot showing the issue.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Adrian Basilio answered 2 years ago

Sorry Abu.
I attach my code and an image so you can understand.
When I add a record in my form, after clicking the save button, it shows a confirmation message (Accept/Cancel). Line 299 of my code.
This message should only be displayed if, when saving my record, I have selected from the dropdown field of the form a specific item that in my llx_activia_vademecum table is marked with the value 1 in the multodroga field.
If that condition is met, the message should be displayed, otherwise it should not be displayed.
I hope I was clear.
I look forward to your comments.
Thank you
ScreenShot follows https://imgur.com/a/FlRxveR
My code follows https://gist.github.com/adrianbasilio/6a2cba000958ab031ccaef0f309c1cfa

Abu Ghufran Staff answered 2 years ago

You can refer this demo code which uses callback function for beforesubmit event.

https://www.gridphp.com/demo/demos/editing/js-validation-form.phps

Line 35: callback function which contains all the posted data as function param
Line 136-152: implementation of callback function.

Here you can get the idea from the code and replace it with yours by putting the confirm() function call based of the field condition and return true based on confirm() result.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Adrian Basilio answered 2 years ago

Thanks Abu.

I am going to review this code and implement it.
Thank you very much as always.
Adrian
Your Answer

20 + 3 =

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?