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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -