I'm getting error when using the JHtmlArea plugin:
An invalid form control with name = 'description' is not focusable.
HTML
<div style="float: left; width:60%; padding:0; margin:0 auto;">
<h1 style="text-align:center; width:100%"">Descrição do assunto</h1><br />
<textarea name="descricao" id="descricao" cols="60" rows="15"></textarea><br /> <br />
</div>
jQuery:
$(document).ready(function() {
$("#descricao").htmlarea();
$("#contato").on("submit", function (){
if($("iframe").val().trim() == "") {
alert("Preencha a descrição do e-mail");
$("#descricao").prop("required",true);
} else {
$("#descricao").prop("required",false);
}
});
Where am I going wrong?
jhtmlarea
is working, but I can not stop sending with the empty description field or focus on it to fill.
Where am I going wrong?
Remember that the plugin creates a iframe
and makes textarea
display: none
.