By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,839 Members | 1,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,839 IT Pros & Developers. It's quick & easy.

validate textbox value from database using ajax call

P: 1
I needed to validate textbox value from database using ajax call.

i have inluded below in jsp file
Expand|Select|Wrap|Line Numbers
  1. <script src="//"></script>
i have below code in .js file

Expand|Select|Wrap|Line Numbers
  1. function validateOtherDiagCodeFromSP_WOTHERICD(num){ 
  2. alert("kinjal "+num); 
  3. var otherDiagCode = document.forms['content:ProviderSubmitClaims'].elements['content:ProviderSubmitClaims:itxEIFOtherDiagCode'+num].value;
  4.  otherDiagCode = trimAll(otherDiagCode).toUpperCase().replace(/[^a-zA-Z0-9]/g,''); //it will convert to uppercase plus replace all characters except numbers and letters
  5.  alert(otherDiagCode); 
  6. CallPageMethod("validateOtherDiagCode", success, fail,otherDiagCode); 
  7. $.ajax({ 
  8. url: "/nva/application/claims/provider/dao/ProSubmitClaimsDAO/validateOtherDiagCode",
  9.  type: "GET", 
  10. data: otherDiagCode, 
  11. dataType: 'json', 
  12. success: function(response){ 
  13. alert("response: "+response); 
  14. }, 
  15. error: function(e){ 
  16. //handle error 
  17. }); 
i am keep getting firebug error "$.ajax is not a function"

can someone please help me what is right way to do this?

Aug 10 '15 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
you’re using jQuery 1.4

jQuery AJAX was added in jQuery 1.5

the current version is jQuery 1.11, resp. 2.1
Aug 10 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.