422
422

Reputation: 5770

change enter to space on dynamic tag plugin

We use a dynamic tag plugin. Currently you need to press enter after each word, to create new tag. I need to change this to spacebar instead of enter key.

I looked for keycode 13 and tried changing to 32 but no worky.

Any ideas, heres a fiddle I created

http://jsfiddle.net/ozzy/tetna/3/

Unminified fiddle.

Upvotes: 0

Views: 284

Answers (1)

James Allardice
James Allardice

Reputation: 165971

I haven't tested this much at all, but it seems to work if you simply change the name of the property 13 in the keys object to 32:

keys: {  
    8:"backspace", 
    9:"tab", 
    32:"space!", //Changed to 32
    27:"escape!", 
    37:"left", 
    38:"up!", 
    39:"right", 
    40:"down!", 
    46:"delete", 
    108:"numpadEnter" 
}

Here's a modified fiddle. Note that I've added in the formatting above, since you have pasted the minified plugin code into the fiddle. It would probably be far easier for you to modify the plugin if you used the un-minified code!

Upvotes: 1

Related Questions