Problem using code in ContactForm
-
Hi,
I had Contact Form routines in my theme footer.php. But suddenly, it stopped working. I researched and had recommendations of this plugin.
After updating and saving the snippet, it does not make the right consistency. I can not get back to working as the routine was in footer.php. What will be my mistake?
Snippet updated.
Name: OnlyNumber
Code:
1 add_action(‘wp_footer’, ‘OnlyNumber’);
2
3 ?>
4 <script>
5 function OnlyNumber(num) {
6 var er = /[^0-9.]/;
7 er.lastIndex = 0;
8 var campo = num;
9 if (er.test(campo.value)) {
10 campo.value = “”;
11 }
12 }
13 </script>
14 <?phpIn the ContactForm, the field that makes the “call” to the “OnlyNumber” routine:
<input class=”num_placa” onkeyup=”OnlyNumber(this);” maxlength=”4″ minlength=”4″ size=”4″ type=”text” />
That is, it accepts letters, numbers, .etc, what the routine would prevent.
Thank you very much
José Cláudio Costa (in live Brazil)
The page I need help with: [log in to see the link]
- The topic ‘Problem using code in ContactForm’ is closed to new replies.