KevinSheedy / jquery.alphanum

Alphanumeric Plugin for jQuery
Other
141 stars 66 forks source link

Can't break line in textarea #41

Closed grimmlink closed 8 years ago

grimmlink commented 9 years ago

Hi,

Using this plugin it appears it's not possible to break lines anymore in textareas. And for a text input, pressing enter doesn't submit the form anymore...

any idea how to unlock this ?

KevinSheedy commented 9 years ago

Hi @grimmlink I'll address the textarea line breaks in this issue. If the text input form submission issue is still a problem, could you create a separate issue for it?

I just added textareas to the the two demo pages, with doctypes: xhtml1 and html5 I tested it in the following environments and breaking lines worked fine. Could you provide more info about your browser and OS and your html? Also, could you try out the demo pages here: index.html and ./test/html5.html

Thanks

MacOS 10.10.2 Chrome 41.0.2272.101 Firefox 35.0.1 Safari 8.0.3

grimmlink commented 9 years ago

Hi,

I'm using Chrome Version 41.0.2272.101 m

here is my declaration

    $('form.west_content input[type="text"], form.west_content textarea').alphanum({
        allow               : 'àâäæçèéêëîïôœùûüÀÂÄÆÇÈÉÊËÎÏÔŒÙÛÜ€£$@\\\'"#&()[]{}/*-+=,?;.:!-_%*',    // Allow extra characters
        disallow            : '',       // Disallow extra characters
        allowEnter          : true,     // Allow the space character
        allowSpace          : true,     // Allow new lines
        allowNumeric        : true,     // Allow digits 0-9
        allowUpper          : true,     // Allow upper case characters
        allowLower          : true,     // Allow lower case characters
        allowCaseless       : true,     // Allow characters that don't have both upper & lower variants - eg Arabic or Chinese
        allowLatin          : true,     // a-z A-Z
        allowOtherCharSets  : false,    // eg é, Á, Arabic, Chinese etc
        forceUpper          : false,    // Convert lower case characters to upper case
        forceLower          : false,    // Convert upper case characters to lower case
        maxLength           : NaN       // eg Max Length
    });

Can't seem to use Enter in the fields, textarea or input. It's part of an application i'm developing, so could be another problem, but i have nothing in the console.

The demo pages work fine. Maybe something to do with twbs...

grimmlink commented 9 years ago

Update: I tried my configuration on the demo page, and I can't use Enter, so there is something wrong in my config...but i can't figure out what.

My goal is to prevent any character that is not a symbol, french or english

KevinSheedy commented 8 years ago

Fixed in 1.0.18 Added an allowNewline flag

LimpEmu commented 8 years ago

I see this issue is closed. Nonetheless I would like to add that the allowNewline flag did not do the trick for me. However adding \r to the list of allow list did work. Thank you for this very nice tool; it saved me much trouble with folks copying and pasting into textarea field!