Ignore:
Timestamp:
Oct 2, 2012 1:57:05 PM (12 years ago)
Author:
anonymous
Message:

Added header and footer to docs/examples. Updated message printing methods to include before, after, and gotohash options. Minor other fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FormValidator.inc.php

    r396 r413  
    176176     * @param   string  $above    Additional message to print above error messages (e.g. "Oops!").
    177177     * @param   string  $below    Additional message to print below error messages (e.g. "Please fix and resubmit").
     178     * @param   string  $print_gotohash_js  Print a line of javascript that scrolls the browser window down to view any error messages.
     179     * @param   string  $hash     The #hashtag to scroll to.
    178180     * @access  public
    179181     * @author  Quinn Comendant <quinn@strangecode.com>
    180182     * @since   15 Jul 2005 01:39:14
    181183     */
    182     function printErrorMessages($above='', $below='')
     184    function printErrorMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg-formvalidator')
    183185    {
    184186        $app =& App::getInstance();
     
    217219            }
    218220            ?></div><?php
     221            if ($print_gotohash_js) {
     222                ?>
     223                <script type="text/javascript">
     224                /* <![CDATA[ */
     225                window.location.hash = '#<?php echo urlencode($hash); ?>';
     226                /* ]]> */
     227                </script>
     228                <?php
     229            }
    219230        }
    220231    }
Note: See TracChangeset for help on using the changeset viewer.