Title: Javascript problem. Submit button on form does nothing.
Last modified: August 21, 2016

---

# Javascript problem. Submit button on form does nothing.

 *  Resolved [420DankStank](https://wordpress.org/support/users/420dankstank/)
 * (@420dankstank)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/javascript-problem-submit-button-on-form-does-nothing/)
 * I have a form on my site. You enter three fields and click submit, and it is 
   supposed to return with some text. The submit button is no longer working. The
   custom plugin php file has this bit of code that I believe is supposed to be 
   the calling function for that submit button.
 * >  $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>’;
 * Does it need to be updated some how to coincide with JQuery 1.9? This was built
   during v.1.6. I’ve tried editing it a few times, but only made it worse.
 * Please help!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [420DankStank](https://wordpress.org/support/users/420dankstank/)
 * (@420dankstank)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/javascript-problem-submit-button-on-form-does-nothing/#post-3664848)
 * There is also this:
 *     ```
       // now we put all of the HTML for the form into a PHP string
       		$content .= '<div id="verify-a-rec" class="clear">';
       			$content .= '<div id="fields">';
       			$content .= '<h4>Verify A 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 a Recommendation ID and 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;
       }
       ```
   
 *  Thread Starter [420DankStank](https://wordpress.org/support/users/420dankstank/)
 * (@420dankstank)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/javascript-problem-submit-button-on-form-does-nothing/#post-3664988)
 * So if I enter info into the form and click submit, nothing is happening on the
   webpage. However, I can check the developer tools -> network tools, it shows 
   the verify php file. I click it and it shows the header requests and responses.
   The header response shows the correct info, but for some reason it is not displayed.
   HELP?
 *  Thread Starter [420DankStank](https://wordpress.org/support/users/420dankstank/)
 * (@420dankstank)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/javascript-problem-submit-button-on-form-does-nothing/#post-3664997)
 * Well, no thanks here, but I did get an answer on Stack Overflow. I had to change
   the first bit of code to remove the ajaxComplete part.
 *     ```
       $j.ajax({
          type: "POST",
          url: "' . $cs_base_dir . 'verify.php",
          data: str,
          success: function(msg){
              $j("#note").html(msg);
           }
        });
       ```
   
 * It works now.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Javascript problem. Submit button on form does nothing.’ is closed to
new replies.

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [plugin not working](https://wordpress.org/support/topic-tag/plugin-not-working/)
 * [submit button](https://wordpress.org/support/topic-tag/submit-button/)

 * 3 replies
 * 1 participant
 * Last reply from: [420DankStank](https://wordpress.org/support/users/420dankstank/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/javascript-problem-submit-button-on-form-does-nothing/#post-3664997)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
