Clear Input Value Only if Already Empty
<p>I'm using some JQuery to mimic the placeholder attribute in browsers that don't support it natively. This is being used on a search form. This search form also has a pagination function that relies on the value attribute to build its pagination. Unfortunately, JQuery clears the search form each time it is submitted. How can I alter the following code to prevent the value from being cleared if it already has a value?</p>

<pre><code>function _emptyFormOnSubmit( $elements )
            {
                var $forms = $elements.closest( 'form' );

                $forms.submit( function()
                {
                    var $this = $( this );

                    // This check avoid processing more than once the same form.
                    if( $this.data( 'placeHoldize.submitHandlerCalled' ) ) {

                        return;
                    }

                    $this.find( '.placeholder-visible' )
                         .val( '' )
                         .data( 'placeHoldize.submitHandlerCalled', true );
                } );

                return true;
            }
</code></pre>
