Answers.Body: <p>Attach a submit event to the #entry-form element:</p>
  
  <pre><code>$('#entry-form').submit(function(e) {
      // code run on submit here
  });
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-06T15:07:48.133Z
Answers.LastActivityDate: 2014-11-06T15:07:48.133Z
Answers.UserDisplayName: Kristian J.
Body: <p>I have implemented a custom field type.</p>
  
  <p>Is there any way to register a javascript event handler that is called before my custom field is saved?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-11-07T15:18:24.833Z
Comments.Text: Here is a full example of [intercepting a request via javascript](http://craftcms.stackexchange.com/questions/4526/linking-to-search-results/4528#4528).
Comments.UserDisplayName: Douglas McDonald
Tags: <custom-fieldtype><custom-field><javascript>
Title: Javascript event on save for custom field
ThreadText: # Javascript event on save for custom field
  
  (Asked by: username_0 on 2014-11-06)
  
  I have implemented a custom field type.
  
  Is there any way to register a javascript event handler that is called before my custom field is saved?
  
  **Tags:** custom-fieldtype, custom-field, javascript
  
  > **Comments:**
  > **username_1**: Here is a full example of [intercepting a request via javascript](http://craftcms.stackexchange.com/questions/4526/linking-to-search-results/4528#4528).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-11-06. Score: 2
  
  Attach a submit event to the #entry-form element:
  
  ```
  $('#entry-form').submit(function(e) {
      // code run on submit here
  });
  
  ```
  
  
  ---
  
  