javascript - jquery form results are not showing. Is my code wrong? -


i having difficulty form. on 1 of pages form. enter info, click submit, , returns result. well, supposed return result. appears nothing, currently. however, if check header responses in developer tools, show results. know being called correctly, not appearing on webpage.

here calling code:

    $content .= '     <script type="text/javascript">         var $j = jquery.noconflict();         $j(window).load(function(){             $j("#pubverify-form").submit(function() {                 var str = $j(this).serialize();                    $j.ajax({                    type: "post",                    url: "' . $cs_base_dir . 'verify.php",                    data: str,                    success: function(msg){                         $j("#note").ajaxcomplete(function(event, request, settings)                         {                             $j(this).html(msg);                         });                     }                  });                 return false;             });         });     </script>'; 

here code believe should show results:

        $content .= '<div id="verify-a-rec" class="clear">';         $content .= '<div id="fields">';         $content .= '<h4>verify recommendation</h4>';         $content .= '<div class="verify_search">';             $content .= '<form id="pubverify-form" action="">';                     $content .= '<div class="label_wrap_verify"><label class="error" for="search_last_name">last name </label>';                     $content .= '<div class="input_wrap_verify"><input name="search_last_name" type="text" id="search_last_name"/></div></div>';                      $content .= '<div class="label_wrap_verify"><label class="error" for="search_dob">birthdate (mm-dd-yyyy) </label>';                     $content .= '<div class="input_wrap_verify"><input name="search_dob" type="text" id="search_dob"/></div></div>';                      $content .= '<div class="label_wrap_verify"><label class="error" for="search_issue_date">issue date (mm-dd-yyyy)</label>';                     $content .= '<div class="input_wrap_verify"><input name="search_issue_date" type="text" id="search_issue_date"/></div></div>';                  $content .= '<div class="button_wrap"><input type="submit" value="verify" class="button" id="pubverify-submit" /></div>';             $content .= '</form>';         $content .= '</div>';         $content .= '</div>';         $content .= '<div style="clear:both"></div>';         $content .= '<div id="note">';         $content .= '<p>enter recommendation id , click verify!</p>';             $content .= '<div class="patient_wrapper">';                 $content .= '<div class="results_label">first name </div>';                 $content .= '<div class="results_label">last name </div>';                 $content .= '<div class="results_label">date of birth </div>';                 $content .= '<div class="results_label">issue date </div>';                 $content .= '<div class="results_label">expiration date </div>';                 $content .= '<div class="results_label">dr. information </div>';             $content .= '</div>';         $content .= '</div>';     $content .= '</div>'; return $content; 

can please help!?

this part wrong.

$j("#note").ajaxcomplete(function(event, request, settings) {     $j(this).html(msg); }); 

you need remove ajaxcomplete code.

$j.ajax({    type: "post",    url: "' . $cs_base_dir . 'verify.php",    data: str,    success: function(msg){        $j("#note").html(msg);     }  }); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -