मैं फॉर्म विधि चेक वैलिटीटी() का उपयोग करने की कोशिश कर रहा हूं।एचटीएमएल 5 फॉर्म चेक वैलिटीटी() विधि नहीं मिली
http://html5test.com/ मुझे बताता है कि मेरा ब्राउज़र (क्रोम) फॉर्म-स्तरीय चेक वैलिटीटी विधि का समर्थन करता है।
हालांकि, का उपयोग कर jsfiddle http://jsfiddle.net/LcgnQ/2/ मैं निम्नलिखित HTML और JavaScript स्निपेट की कोशिश की है:
<form id="profileform" name="profileform">
<input type="text" id="firstname" required>
<input type="button" id="testbutton" value="Test">
</form>
$('#testbutton').bind('click',function(){
try{
alert($('#profileform').checkValidity());
}
catch(err){alert('err='+err)};
});
मैं एक त्रुटि हो रही है: object has no method checkValidity()
क्या मैं गलत कर रहा हूँ?
धन्यवाद।
यहां http://stackoverflow.com/questions/28979662/common-jquery-to-disable-submit-buttons-on-all-forms-after-html5- validation/36391754#36391754 आप मुझे और अधिक "जेनेरिक "और पूरा समाधान। – Petr
आप कोशिश कर सकते हैं: 'document.getElementById (" प्रोफाइलफॉर्म ")। चेक वैलिटी()' – sept08