在CodeIgniter中的FancyBox中显示验证错误

时间:2015-07-16 02:15:49

标签: php codeigniter validation fancybox

我在主页上有一个包含注册表格的FancyBox。

验证工作正常。

目前,我必须手动点击FancyBox才能看到该表单上的错误消息。

这是重新加载页面的代码。但我希望它在页面加载后立即显示FancyBox。这只是一个简单的验证检查。

public static void compressString (String string) {
    StringBuffer stringBuffer = new StringBuffer();

    for (int i = 0; i < string.length(); i++) {
        int count = 1;
        while (i + 1 < string.length()
                && string.charAt(i) == string.charAt(i + 1)) {
            count++;
            i++;
        }

        if (count > 1) {
            stringBuffer.append(count);
        }

        stringBuffer.append(string.charAt(i));
    }

    System.out.println("Compressed string: " + stringBuffer);
}

所以我想要的是显示FancyBox的验证错误。

验证工作正常,因为它在FancyBox中显示;当页面重新加载时,我必须手动点击该FancyBox才能看到验证错误。有没有办法将它存储在会话中并使用它?如果有,怎么样?或者我如何使用ajax,并在FancyBox上显示验证错误?

1 个答案:

答案 0 :(得分:0)

您可以看到以下示例。尝试使用ajax和jquery实现它。

-[UIRefreshControl setRefreshControlState:]: message sent to deallocated instance 0x178e52a0