How can I access elements from a response script ?

How can I access elements from a response script ?

Hello 

I go a situation here,    I want to call a ajax after getting result of first ajax.
Please see my code. here it is validating form correctly but when submit it is not working the ajax submission and after submission grid reload.

  1. jQuery(document).ready(function(){
  2. jQuery("#form").validate({
  3.  rules: {
  4. data: "required",
  5. desc: "required",
  6. cost: "required",
  7. price: "required",
  8. qty: "required"
  9.  },
  10.  messages: {
  11. data: "<?php echo $this->lang->line('field_reuired'); ?>",
  12. desc: "<?php echo $this->lang->line('field_reuired'); ?>",
  13. cost: "<?php echo $this->lang->line('field_reuired'); ?>",
  14. price: "<?php echo $this->lang->line('field_reuired'); ?>",
  15. qty: "<?php echo $this->lang->line('field_reuired'); ?>"
  16.  },
  17.  submitHandler: function(form) {
  18. v1first_ajax(form).success(v1second_ajax);
  19.  }
  20. });
  21. });

  22. function v1first_ajax(form){
  23. jQuery.ajax({
  24. url: "<?php echo base_url() ?>controller/savedata",
  25. type: "POST",
  26. data: jQuery(form).serialize(),
  27. success: function(response) {
  28. //$('#inquiryFormHolder').html("Your form was submitted!");
  29. //console.log(response);
  30. }            
  31. });
  32. }
  33. function v1second_ajax(){
  34. var value = jQuery("#myval").val();
  35. jQuery.post( "<?php echo base_url() ?>controller/ajax/", { values:value } );
  36. }