php - Codeigniter validation messages in an alertbox -
I'm using the flexi auth library Now I need to display some verification error message in the warning box. How To Display!
Currently showing in this way.
If ($ this-> form_validation- & gt; play () == FALSE) {// code error $ data for ['message_type'] = 1; $ Data ['message'] = 'below required field'; $ The- & gt; Load-> View ('General / Message', $ data)}
Error throwing on your view Try to see error on seeing: -
& lt ;? Php if (validation_errors ()! = False) {echo '& lt; Script & gt; Alert "Please check the error marked in red.") & Lt; / Script & gt; '; ?} & Gt; Or you want any error: -
& lt ;? Php if (form_error ('loan amount')) {echo '& lt; Script & gt; Alert ("Error") & lt; / Script & gt; '; ?} & Gt; Try to warn an error in the field
& lt ;? Php if (form_error ('loanamount'))? & Gt; & Lt; Script & gt; Alert ('& lt;? Php eco form_rir (' loan amount ') ;? gt; & gt;'); & Lt; / Script & gt; & Lt ;? Php}? & Gt; The error set set will show according to the rules such as
$ this-> form_validation- & gt; Set_rules ('loan amount', 'loan amount', 'trim | necessary | xss_clean'); You are sending $ data so that you can also alert $ data variables in alerts
Comments
Post a Comment