Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ public static function form_classes( $form ) {
self::add_js_validate_form_to_global_vars( $form );
}

if ( ! FrmFormsHelper::should_use_pro_for_ajax_submit() && FrmForm::is_ajax_on( $form ) ) {
if ( FrmForm::is_ajax_on( $form ) ) {
echo ' frm_ajax_submit ';
}
}
Expand Down
26 changes: 14 additions & 12 deletions classes/helpers/FrmFormsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1805,18 +1805,6 @@ public static function maybe_add_sanitize_url_attr( $url, $form_id ) {
return str_replace( $original_query, $query, $url );
}

/**
* Check if Pro isn't up to date yet.
* If Pro is active but using a version earlier than v6.2 fallback to Pro for AJAX submit (so things don't all happen twice).
*
* @since 6.2
*
* @return bool
*/
public static function should_use_pro_for_ajax_submit() {
return is_callable( 'FrmProForm::is_ajax_on' ) && ! is_callable( 'FrmProFormsHelper::lite_supports_ajax_submit' );
}

/**
* Outputs the appropriate button text in the publish box.
*
Expand Down Expand Up @@ -1872,4 +1860,18 @@ public static function actions_dropdown( $atts ) {
$links = self::get_action_links( $form_id, $status );
include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/actions-dropdown.php';
}

/**
* Check if Pro isn't up to date yet.
* If Pro is active but using a version earlier than v6.2 fallback to Pro for AJAX submit (so things don't all happen twice).
*
* @since 6.2
* @deprecated x.x
*
* @return bool
*/
public static function should_use_pro_for_ajax_submit() {
_deprecated_function( __METHOD__, 'x.x' );
return false;
}
}
20 changes: 9 additions & 11 deletions classes/views/frm-forms/settings-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,15 @@
</td>
</tr>
<?php do_action( 'frm_add_form_ajax_options', $values ); ?>
<?php if ( ! FrmFormsHelper::should_use_pro_for_ajax_submit() ) { ?>
<tr>
<td>
<label for="ajax_submit">
<input type="checkbox" name="options[ajax_submit]" id="ajax_submit" value="1" <?php checked( $values['ajax_submit'], 1 ); ?> />
<?php esc_html_e( 'Submit this form with AJAX', 'formidable' ); ?>
<?php FrmAppHelper::tooltip_icon( __( 'Submit the form without refreshing the page.', 'formidable' ) ); ?>
</label>
</td>
</tr>
<?php } ?>
<tr>
<td>
<label for="ajax_submit">
<input type="checkbox" name="options[ajax_submit]" id="ajax_submit" value="1" <?php checked( $values['ajax_submit'], 1 ); ?> />
<?php esc_html_e( 'Submit this form with AJAX', 'formidable' ); ?>
<?php FrmAppHelper::tooltip_icon( __( 'Submit the form without refreshing the page.', 'formidable' ) ); ?>
</label>
</td>
</tr>
<tr>
<td>
<label for="js_validate" class="frm_inline_block">
Expand Down