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

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -