WordPress.org

Ready to get started?Download WordPress

Forums

ContestHopper for WordPress
Not submintting form (13 posts)

  1. gfserver
    Member
    Posted 6 months ago #

    Hello again, this plugins seems to have all my requeirements but I couldnt figure out why the form is not submitting.

    I've checked the form page using chrome console and can not grab the error

    http://www.grupoeditoresvenezolanos.com/site/concurso-de-prueba/

    Any help is appreciated!!

    It looks like a great plugin, and I need it working ASAP please.

    Many thanks in advance, sorry for my bad english

    https://wordpress.org/plugins/contesthopper/

  2. gfserver
    Member
    Posted 6 months ago #

    Hello, error found in firebug console:

    ReferenceError: ch_ctdn is not defined
    ch_ctdn('2591234', 'ch_widget-2042_1');

    in this lines

    jQuery(document).ready(function() {
    ch_ctdn('2591234', 'ch_widget-2042_1');
    });

    My shortcode is [contesthopper contest="2042"]

    My theme is City Desk by Gabfire themes

    Installed plugins:

    Akismet

    Contact form 7

    Contact Form DB

    ContestHopper for WordPress

    Ninja Pages, Categories, and Tags

    PHP Text Widget

    Really Simple CAPTCHA

    Widget Logic

    WP Bannerize

    WP e-Commerce

    I tried the plugin in a fresh WP 3.8.1 installation and it works like a charm!!!

    http://www.gfserver.com.ve/demowp/concurso/

    Thanks to Carlos-Vazquez for the spanish translation and Webikon for creating this awesome plugin, but I´m stucked in my client's page, help needed!

  3. Webikon
    Member
    Plugin Author

    Posted 6 months ago #

    Hello,
    thank you for the feedback.

    It seems that contesthopper front-end javascript and CSS is not loading on your page. From the plugin list I don't see anything suspicious. Maybe the theme is causing that, but this is not straightforward to debug.

    You can try to work around this by manually adding
    CSS file (wp-content/plugins/contesthopper/templates/default/widget.css)
    and enqueue+localize ch_js_widget

    wp_enqueue_script('ch_js_widget');
    wp_localize_script('ch_js_widget', 'ch_ajax', array('ajaxurl' => admin_url('admin-ajax.php')));
  4. gfserver
    Member
    Posted 6 months ago #

    Hello Webikon, thanks very much for your answer.

    I added the css code into the default css theme file and now it looks OK, then I added the two lines of code you kindly indicated in the wp-includes/functions.wp-scripts.php file, but although now it shows the remaining days, it is still not working.

    function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
    global $wp_scripts;
    if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    if ( ! did_action( 'init' ) )
    _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    'wp_enqueue_scripts', 'admin_enqueue_scripts', 'login_enqueue_scripts' ), '3.3' );
    $wp_scripts = new WP_Scripts();
    }

    $wp_scripts->add( $handle, $src, $deps, $ver );
    if ( $in_footer )
    $wp_scripts->add_data( $handle, 'group', 1 );

    wp_enqueue_script('ch_js_widget');
    }

    ---------------------------

    function wp_localize_script( $handle, $object_name, $l10n ) {
    global $wp_scripts;
    if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    if ( ! did_action( 'init' ) )
    _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    'wp_enqueue_scripts', 'admin_enqueue_scripts', 'login_enqueue_scripts' ), '3.3' );

    return false;
    }

    return $wp_scripts->localize( $handle, $object_name, $l10n );

    wp_localize_script('ch_js_widget', 'ch_ajax', array('ajaxurl' => admin_url('admin-ajax.php')));
    }

    Where should I add this code?

    Again...Thanks very very much!!

  5. steviphoto
    Member
    Posted 6 months ago #

    I'm having the same issue. I have no idea how to do code.

    Is there any way you can help?

    http://steviclackphotography.com/blog/happy-birthday-to-us/

  6. Webikon
    Member
    Plugin Author

    Posted 6 months ago #

    chuo999,

    never ever edit core files. the two lines need to go to your theme functions.php, and have to be called in a hook

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script
    http://codex.wordpress.org/Function_Reference/wp_localize_script

  7. Webikon
    Member
    Plugin Author

    Posted 6 months ago #

    steviphoto,

    you have a javascript error, probably because two jquery versions are called.
    is your theme a custom one?

    juraj

  8. gfserver
    Member
    Posted 6 months ago #

    Thanks very much!

    I added this to my theme's functions.php file

    function theme_name_scripts() {

    wp_enqueue_script('ch_js_widget');
    wp_localize_script('ch_js_widget', 'ch_ajax', array('ajaxurl' => admin_url('admin-ajax.php')));
    }

    add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );

    Now is working.. Thanks!

  9. Webikon
    Member
    Plugin Author

    Posted 6 months ago #

    no problem,
    now enjoy some contest hoppin' :)

  10. gfserver
    Member
    Posted 6 months ago #

    Thanks for this great plugin and for your support!

  11. steviphoto
    Member
    Posted 6 months ago #

    Yes, my theme is custom.

  12. steviphoto
    Member
    Posted 6 months ago #

    Yes, my theme is custom.

  13. Webikon
    Member
    Plugin Author

    Posted 6 months ago #

    steviphoto,

    well, you need to make sure your theme uses the same jquery version that wordpress does. this is done easily with enqueue_script.

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    since you say, you have no idea how to code, try to contact the person who created the template for you.

    cheers,

    juraj

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.