I’m using a bit of JQuery code to create placeholder values for browsers that don’t support them natively. The code clears the forms whenever submit is triggered. Unfortunately, my pagination system is using a select dropdown menu with onchange="this.form.submit()" and the code does not empty the forms when this is used. How can I change the following code to work with my select pagination?
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;
}
maybe this will work :
it’s like your mixing inline attribute event and JQuery event which are based on event handler and are not well connected with inline attribute event.
Maybe (better) in your select onchange you can write :