javascript - Validating Password and Retype Password -


मुझे इस तरह से दो टेक्स्ट बॉक्स हैं:

  & lt; p & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" नाम = "NPassword" प्लेसहोल्डर = "नया पासवर्ड" / & gt; & lt; / p & gt; & Lt; input type = "text" name = "RNPassword" प्लेसहोल्डर = "नया पासवर्ड पुनः टाइप करें" / & gt;   

अब, क्या मैं चाहता हूँ कि पुन: लिखें नया पासवर्ड हर कुंजी दबाने पर यह करता है, तो दोनों एक ही या हाँ तो हरे रंग में यह RNPassword के दाईं ओर प्रदर्शित नहीं.अगर की जांच करनी चाहिए, अन्यथा है लाल रंग डिस्प्ले में जो दोनों समान नहीं हैं और पृष्ठ के सबमिट बटन को अक्षम भी कर सकते हैं। यह कैसे किया जा सकता है कृपया मदद करें।

जे एस

  समारोह isPasswordMatch () {var पासवर्ड = $ ( "# txtNewPassword") वैल ()।; Var confirmPassword = $ ("# txtConfirmPassword")। Val (); अगर (पासवर्ड! = पुष्टि पासवर्ड) $ ("# divCheckPassword")। Html ("पासवर्ड मेल नहीं खाते!"); और $ ("# divCheckPassword")। Html ("पासवर्ड मैच।"); } $ (दस्तावेज़) .ready (फ़ंक्शन () {$ ("# txtConfirmPassword") कुंजीपटल (isPasswordMatch);});   

बटन डेमो कोड अक्षम करें

  $ ('# हल्क')। Prop ('disabled', true); $ ( '# TxtConfirmPassword') ( 'KeyUp', समारोह () पर {var पासवर्ड = $ ( "# txtNewPassword") वैल ();।।। वर confirmPassword = $ ( "# txtConfirmPassword") वैल (); अगर ( ! पासवर्ड = confirmPassword) {$ ( "# divCheckPassword") एचटीएमएल ( "पासवर्ड मेल नहीं खाते!");।} else {$ ( "# divCheckPassword") एचटीएमएल ( "पासवर्ड मेल खाते हैं।");। $ ( '# हल्क ') .प्रॉप (' अक्षम ', गलत);}});    

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

Simple file compression in C -

php - Sorting an multidimension array using usort fails -