forms - Codeigniter callback on empty fields? -


I'm having problems with callbacks on empty areas.

For some reason, I need to compare the price to some area with some other criteria and to make it "necessary" if some other conditions are met, then check it with the callback function .

Unfortunately, if the field is empty, the callback function is not called.

Are you thinking of resolving this issue?

This "bug" is actually a "feature" of the form validation if the input is empty and the necessary rules If not set, it will leave all other rules (non-callback function also)

in the system / library / form_dualtion.fp about line 486, all of you You can extend the verification (or hack) to continue through the tasks. See the comment:

  // If the field is empty but is not required, then no further testing is needed   

You can again create two lines Will see return; Shortly after that comment, lines for me are line 498 and line 536 (about 12 and 50 lines after comment). If you comment on these two rows, the verification will continue through all the functions, even if the input is empty.

It is being said that you have the application / library / form_validation.fp and _execute function:

  Lt ;? Php if () define ('BASEPATH') exit ('not allow script entry permissions'); class MY_Form_validation extends CI_Form_validation {secure function _execute ($ line, $ rule, $ postdata = NULL, $ cycles = 0) {...}}   

Simply copy the entire function to new file and return the two mentioned above.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -