मुझे एक ही समस्या है, जहां मैं अगले क्षेत्र में टैब पर numpad पर + दबा देना चाहता था। अब मैंने एक पुस्तकालय जारी किया है जो मुझे लगता है कि आपकी मदद करेगा।
PlusAsTab: एक jQuery कुंजीपटल एक टैब कुंजी समकक्ष के रूप में numpad प्लस कुंजी का उपयोग करने के लिए एक jQuery प्लगइन।
आप चाहते चूंकि/↵ बजाय, आप विकल्प सेट कर सकते दर्ज करें। पता लगाएं कि आप किस कुंजी का उपयोग jQuery event.which demo के साथ करना चाहते हैं।
JoelPurra.PlusAsTab.setOptions({
// Use enter instead of plus
// Number 13 found through demo at
// https://api.jquery.com/event.which/
key: 13
});
नमूना HTML
<!-- Enable enter as tab as the default for all fields in this form -->
<form data-plus-as-tab="true">
<input type="text" value="Enter skips to the next field" autofocus="autofocus" />
<!-- Exclude this textarea -->
<textarea data-plus-as-tab="false">Enter works as usual</textarea>
<input type="text" value="Enter skips to the next field" />
<select><option>Enter skips here too</option></select>
<!-- Exclude this submit button -->
<button type="submit" data-plus-as-tab="false">Enter works as usual</button>
</form>
आप देख सकते हैं, यह data-plus-as-tab="true"
के साथ एक कंटेनर में सभी तत्वों को सक्षम करने के लिए आसान है, और यह data-plus-as-tab="false"
साथ विशिष्ट तत्वों को बाहर करने में आसान है। आप $('textarea, :button').plusAsTab(false);
के साथ जावास्क्रिप्ट से कुछ प्रकार (मौजूदा तत्वों पर) को भी बाहर निकाल सकते हैं।
आप PlusAsTab enter as tab demo में इसे अपने आप आज़मा सकते हैं।
स्रोत
2012-02-17 18:00:03
के संभावित डुप्लिकेट [कुंजी दबाएँ दर्ज Javascript में एक टैब की तरह बर्ताव] (http: // stackoverflow .com/प्रश्न/100 9 808/enter-key-press-behaves-like-a-tab-in-जावास्क्रिप्ट) –
इस प्रश्न के बाद से अच्छा विलय उम्मीदवार विशेष रूप से jQuery समाधान मांग रहा है। एंड्रयू व्हिटकर के लिए – xan
उत्तर वास्तव में अच्छा है और अन्य प्रश्नों में समान या संबंधित में स्थापित नहीं है। –