HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/gopalak/public_html/wp-content/plugins/charitable/assets/js/charitable-forms.js
( function( $ ) {
	/**
	 * Disable forms after submission.
	 */
	var disable_forms_after_submission = function( forms ) {
		forms.forEach( function(form) {
            var $form = $(form);

            if ( $form.length ) {
                $form.append( '<input type="hidden" id="charitable-submit-button-value" />' );

                $form.find( '[type=submit]' ).on( 'click', function( event ) {
                    /* If the form submission isn't valid, proceed no further. */
                    if ( ! $form[0].checkValidity() ) {
                        return;
                    }

                    var name = event.currentTarget.name,
                        value = event.currentTarget.value;

                    $form.find( '#charitable-submit-button-value' )
                        .attr( 'name', name )
                        .attr( 'value', value );

                    $form.find( '[type=submit]' )
                        .attr( 'disabled', 'disabled' );

                    return $form.submit();
                } );
            }
        } );
	}

	$( document ).ready( function() {
		disable_forms_after_submission(
			[
				'#charitable-registration-form',
				'#charitable-profile-form',
				'#charitable-campaign-submission-form'
			]
		);
	} );
})( jQuery );