WordPress.org

Ready to get started?Download WordPress

Forums

WP Slider Captcha
Saving options fails and mobile devices (1 post)

  1. viancen
    Member
    Posted 1 year ago #

    Hi,

    Great work, but you have some bugs. I have some custom forms (several) which i want to enable your plugin on. But when i save the settings page it clears all values. I have now manualy inserted the values in the db... could you fix this?

    The second thing is mobile devices, they are now not able to submit the forms. So i added some code to your js file, maybe you can use this :)

    jQuery(function($) {
        if (!window.jQuery) {
            try {
                document.write('<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></scr'+'ipt>');
            }
            catch (e) {
                console.log('Error occurred: ' +e.message);
            }
        }
        else if (!window.jQuery.ui) {
            try {
                document.write('<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></scr'+'ipt>');
            }
            catch (e) {
                console.log('Error occurred: ' +e.message);
            }
        }
        else {
    
            var is_mobile = false;
            if (navigator.userAgent.match(/Android/i) ||
                navigator.userAgent.match(/webOS/i) ||
                navigator.userAgent.match(/iPhone/i) ||
                navigator.userAgent.match(/iPad/i) ||
                navigator.userAgent.match(/iPod/i) ||
                navigator.userAgent.match(/BlackBerry/) ||
                navigator.userAgent.match(/Windows Phone/i) ||
                navigator.userAgent.match(/ZuneWP7/i)
            ) {
                is_mobile = true;
            }
    
            if(is_mobile === false){
    
                var $form      = $('#' + wpsc_settings['wpsc_form_id']),
                threshold  = wpsc_settings['wpsc_threshold'],
                $captcha   = $('<div id="wp-slider-captcha"><p id="wp-slider-info">Sleep de blauwe punt naar rechts (minimaal '+threshold+'%)</p></div>');
    
                $form.find(':submit').remove();
    
                $captcha.slider({
    
                    // whenever it's value is changed (after button release)
                    change: function(evt, ui) {
    
                        // if over given value...
                        if(ui.value > threshold) {
                            $form.submit();
                        }
    
                        else {
                            ui.value = 0;
                        }
                    }
                });
    
                $form.append($captcha);
            }
        }
    });

    thanks.

    http://wordpress.org/extend/plugins/wp-slider-captcha/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.