0
I’m getting error using the plugin Jhtmlarea:
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?
To jhtmlarea
is working, but I can’t stop sending with the empty description field nor put the focus on it for filling.
Where am I wrong?
Vale remember that the plugin creates a iframe
and makes the textarea
display: none
.
add required to the plugin. that’s the problem. I’ve already put the link d plugin.
– Carlos Rocha
No, it’s really lack of attention. But I fixed it here. But I still can’t put Focus() in jhtmlarea.
– Carlos Rocha
Are you having trouble validating or just playing the field focus
– Euler01
Both. In fact, when the plugin enters the scene, it hides the textarea and displays an iframe on top. Only, if you have nothing filled in I can’t send an alert and in that case it shows no error or nothing to the user, just do not submit the form
– Carlos Rocha
Managed to solve the problem?
– PauloHDSousa
I thought I had got as answer I gave below. But it did not work!
– Carlos Rocha