Making an html element created using javascript "required" -


var textbox = function(me) {     if (me.checked == false) {         var textb = document.createelement('textarea');          textb.name = "address";         textb.id = "address";         textb.required;         textb.placeholder = "address";         me.parentnode.appendchild(textb);     }      setinterval(function() {         if (me.checked == false) {             me.parentnode.removechild(textb);             return false;         }     }); }; 

this the java script code wrote display text area (named textb) when radio button selected. though put "textb.required" text area not made compulsory field (that if person selects radio button , not fill address error not returned)

please me correct this


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -