![]() |
Admin 1/11/2024 |
You can use Field Events for this purpose: This will allow you to perform validation and display SweetAlert message without reloading the page, as soon as this field loses the focus. We also had a DevClub webinar dedicated to this technique back in June:
|
![]() |
fhumanes 1/12/2024 |
Hi @kelgate, Look at this example that makes the validation of a field with recovery of information in the Server. https://fhumanes.com/blog/guias-desarrollo/guia-27-validaciones-por-ajax-personalizados/ In the article is the error message in an "alert" and in the example it is in the standard format of PHPRUNNER. Greetings, |
K
|
kelgate author 1/12/2024 |
Many thanks "Admin". I have used Field Events as one of my techniques to handle validation and it works well as far as the initial run through for both Return True (where the entered value is acceptable, with just a warning if low) and Return False cases (where the entered value is greater than the maximum allowable score). The issue is that in the Return False case the page is not reloaded so the entered (too high) value is still present in the input field, but if the User clicks the save checkmark a second time then the Field Event is not triggered so there are no Field event validation checks performed and the invalid value is then saved. This is using the "standard" in-line edit page. Would it be different if I used Spreadsheet Mode? Thanks Fernando, I'll get your example translated and take a more detailed look. All the best to Both. Kelvin |
![]() |
Admin 1/12/2024 |
There tons of options here.
|
K
|
kelgate author 2/14/2024 |
Many thanks for your suggestions and apologies for my delay in responding. I have tried the options you have suggested and have managed to get a field event example working. However, I have more than one score field in a the relevant table (round-1, round-2, round-3, etc), so the custom field validation plugin is the most convenient for multiple use. But, I'm struggling to get the Max Score value into the function using in-line edit in a list view. My code is: function score_validate(sVal) if(sVal > ctlMaxInt) } but this doesn't work. If I just put a fixed value into ctlMaxInt it works fine, but since the maximum score can vary row-by-row this isn't an option. I haven't tried setting the score value to zero from this function either, but it is something I'd also like to be able to do. Thanks again Kelvin |
K
|
kelgate author 2/17/2024 |
Thanks folks, I do have an outstanding question, but you outlined several options, so I'll mark this one as Solved and open another thread with my question. Thanks again Kelvin |