function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hareeshnhareeshn 

query working for <input type="text" id="txtboxToFilter" />,,not working for <apex:inputText id="txtboxToFilter"/>

jquery is not workin for  <apex:inputText  help me on this 

<apex:page >

  <script src="https://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="/soap/ajax/26.0/connection.js" type="text/javascript"></script>
    <script src="https://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css"/>
    <apex:form >
    <script>
    $(document).ready(function() {
    $("#txtboxToFilter").keydown(function(event) {
        // Allow only backspace and delete
        if ( event.keyCode == 46 || event.keyCode == 8 ) {
            // let it happen, don't do anything
        }
        else {
            // Ensure that it is a number and stop the keypress
            if (event.keyCode < 48 || event.keyCode > 57 ) {
           
            alert('please enter numaric');
                event.preventDefault();
            }  
        }
    });
});
  
    </script>
   
    <body>
    <p>click i will diss apire</p>
   
    <apex:inputText id="txtboxToFilter"/>
   <input type="text" id="txtboxToFilter" />
    <button>Click me</button>
    </body>
   </apex:form>
</apex:page>
bob_buzzardbob_buzzard
When you specify an id for a Visualforce component, a bunch of information is tacked on to the front of it. Use the $Component global to get the correct id for the component, as detailed at:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_access.htm