Skip to content

Commit

Permalink
fixed form errors display
Browse files Browse the repository at this point in the history
  • Loading branch information
themefuse committed Dec 15, 2014
1 parent 2618600 commit 8245684
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions scratch-parent/inc/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,9 @@ function _action_theme_display_form_errors() {
);

wp_localize_script( 'fw-theme-show-form-errors', '_localized_form_errors', array(
'errors' => $form->get_errors(),
'form_attr' => $form->attr()
'errors' => $form->get_errors(),
'form_id' => $form->get_id()
) );
}

add_action( 'wp_enqueue_scripts', '_action_theme_display_form_errors' );
endif;
add_action( 'wp_enqueue_scripts', '_action_theme_display_form_errors' );
2 changes: 1 addition & 1 deletion scratch-parent/js/form-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
(function(localized){
jQuery(function($){
var $form = $('form#'+ localized.form_attr.id);
var $form = $('form.fw_form_'+ localized.form_id);

if (!$form.length) {
return;
Expand Down

0 comments on commit 8245684

Please sign in to comment.