开发者

HTML/PHP Form - Not allowing me to make a space in a textbox input

开发者 https://www.devze.com 2023-02-08 13:40 出处:网络
I a开发者_StackOverflow中文版m trying to make a space in the textboxes after you click [UPLOAD YOUR OWN PHOTO] on http://www.maltarestaurantreviews.com/

I a开发者_StackOverflow中文版m trying to make a space in the textboxes after you click [UPLOAD YOUR OWN PHOTO] on http://www.maltarestaurantreviews.com/

I double checked the code and found nothing that is stopping me from writing a SPACE in my text.


Seems like you have a space Keydown event attached to your spacebar on the entire page.

Failed to load resource: the server responded with a status of 404 (Not Found)

everytime you hit spacebar.

it is reside in this script: /js/jquery.galleriffic.js

    // Setup Keyboard Navigation
            if (this.enableKeyboardNavigation) {
                $(document).keydown(function(e) {
                    var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
                    switch(key) {
                    /* right here =>    case 32: // space
                            gallery.next();
                            e.preventDefault();
                            break; */
//continue code...

Are you using the gallery's space keydown functions if not just remove it else make sure the form isn't conflicting w/ the space keydown. However, it might cause some side effects that you might not want. So, it's really specific to what you want to do with the entire site.


If the only plugin with the key event handler is galleriffic, then simply uncommenting the following lines

/case 32: // space gallery.next(); e.preventDefault(); break;/

would solve your problem.

I've had that issue before. That was exactly how i fixed it.


This works for me:
    // Setup Keyboard Navigation

    if (this.enableKeyboardNavigation) {
        $(document).keydown(function(e) {

            var target = e.target || e.srcElement; // hack
            //disable navigation on an input editable element
            if (target && target.type) return true;         

            var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
            switch(key) {
                case 32: // space
                        gallery.next();
                        e.preventDefault();
                        break;
                case 33: // Page Up
                    gallery.previousPage();
                    e.preventDefault();
                    break;
                case 34: // Page Down
                    gallery.nextPage();
                    e.preventDefault();
                    break;
                case 35: // End
                    gallery.gotoIndex(gallery.data.length-1);
                    e.preventDefault();
                    break;
                case 36: // Home
                    gallery.gotoIndex(0);
                    e.preventDefault();
                    break;
                case 37: // left arrow
                    gallery.previous();
                    e.preventDefault();
                    break;
                case 39: // right arrow
                    gallery.next();
                    e.preventDefault();
                    break;
            }
        });
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号