jQuery( document ).ready( function () {

	validation_for_forms_func(
		'#commission_for_each_sale',
		/^[0-9]*$/,
		'#commission_for_each_sale_error',
		'Enter Numbers'
	);

	function validation_for_forms_func( inputId, regex, errorId, errorString ) {
		jQuery( inputId ).on( 'keyup', function () {
			if ( ! regex.test( this.value ) ) {
				jQuery( errorId ).html( '<div class="text-danger">' + errorString + '</div>' );
			} else {
				jQuery( errorId ).html( '' );
			}
		} );
	}

} );
