jQuery in own widget
-
Hello,
I am creating my own WP widget and am trying to use jQuery for a form validation.
For now I just want to hide the error-<p> when the page is loaded.<table class='widget-contato'><form action=''> <tr><td>Nome</td><td><input name='widget_name' class='widget-contato'><p class='widget-contato-error'>Por favor, informe seu nome.</p></td></tr> <tr><td>Telefone</td><td><input name='widget_phone' class='widget-contato'><p class='widget-contato-error'>Por favor, informe seu nome.</p></td></tr> <tr><td>Email</td><td><input name='widget_mail' class='widget-contato'></td></tr> <tr><td>Mensagem</td><td><textarea name='widget_text' class='widget-contato'></textarea></td></tr> </form></table> <input value='Orcamento' type='submit' class='widget-contato-button'> </div></div> <script> $(document).ready(function(){ $(".widget-contato-error").hide(); }); </script>
in the header I have jQuery included. But the <p class=’widget-contato-button’> does not hide.
Can anyone help me please?
Thanks!
- The topic ‘jQuery in own widget’ is closed to new replies.