Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai


Here is my code


i am getting the error as Microsoft JScript runtime error: Object expected while using jquery


JavaScript
<script type="text/jscript">
      $(document).ready(function () {
          $("#SUBJECT_TO_LIMIT").blur(function () {
              var x = $("#SUBJECT_TO_LIMIT").val();
              if (x>100) {
//                  alert(x);
                  document.getElementById('SUBJECT_TO_LIMIT').style.borderColor = "red";
                  document.getElementById('SUBJECT_TO_LIMIT').focus();                 
                  return false;
              }
              else {
                  document.getElementById('SUBJECT_TO_LIMIT').style.borderColor= '';
                  return true;
              }           

          });
      });
</script>
Posted
Updated 17-Oct-13 21:12pm
v2
Comments
[no name] 18-Oct-13 3:26am    
Any particular line of code where u are getting the error..??
JoCodes 18-Oct-13 3:32am    
Are you getting the object expected error in the first line itself or in the subsequent selectors?if its the first line you might have forgot to add the JQuery reference to the page
JasonMacD 18-Oct-13 14:57pm    
I second JoCodes comment, if it is the generic Object error, you have not added a reference to the jquery .js file in your page.
Anji Chelloju 28-Nov-13 7:11am    
I have written onclick event to textbox.but i haven't written script for that onclik event in page ....so it searched for onclick method ....it was not found .....so that i got that error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900