开发者

how to show success message for each field in codeigniter

how to show success message against each form field like we show error message for each field..when i write

<?if(form_error('username')) {
  //show error message
}
else
   // show success message
?>

it shows success message when the form is loaded witho开发者_JAVA技巧ut validating anything..


Pretty much the same way you would test to see if the form has already been submitted... (and don't use short tags)

<?php 
    if(form_error('username')) {
      //show error message
    } elseif (isset($_REQUEST['submit_button_value'])) {
       // show success message
    }
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜