<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>

CC BY-SA 3.0
2014-11-06T15:07:48.133Z
2014-11-06T15:07:48.133Z
Kristian J.
<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>

CC BY-SA 3.0
2014-11-07T15:18:24.833Z
Here is a full example of [intercepting a request via javascript](http://craftcms.stackexchange.com/questions/4526/linking-to-search-results/4528#4528).
Douglas McDonald
<custom-fieldtype><custom-field><javascript>
Javascript event on save for custom field
# 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
});


---

