Issue with jquery onkeyup function
-
I have below code in my one of the page. It will validate a textbox for hexadecimal values.
I did this code testing on my local system \ jsfiddle and on php fiddle.its working fine there. and once I put this on my wordpress site it is not functioning.(Error message not working)html:
<div class="input-resp-hpux-vbus"><span><input class="textbox" id="vbus-id" name="vbus-id" type="text" /></span></div> <div id="test"></div> <script type="text/javascript" src="https://sitename.com/wordpress/wp-content/themes/freshlife/includes/js/emcsaninfo-symcli.js"></script>
and jquery code:
$(document).ready(function () { $('#vbus-id').keyup(function () { var text_value = document.getElementById("vbus-id").value; if (!text_value.match(/\b[0-9A-F]\b/gi)) { document.getElementById("vbus-id").value = ""; // document.getElementById("vbus-id").focus(); var message = "You have entered a invalid id.Vbus id ranges from 0 to F in hexadecimal"; test.innerHTML = message; } else test.innerHTML = ''; }); });
I have included the above javascript code on emcsaninfo-symcli.js file. Any reason the script not working
a PHP fiidle setup here for this code
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Issue with jquery onkeyup function’ is closed to new replies.