# Handle form data before send

**URL:** https://forum.mautic.org/t/handle-form-data-before-send/9744
**Category:** Product Support
**Created:** [October 19, 2017, 8:41pm UTC](https://forum.mautic.org/t/handle-form-data-before-send/9744 "2017-10-19T20:41:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hmaesta](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@hmaesta](https://forum.mautic.org/u/hmaesta)
#### Post date: [October 19, 2017, 8:41pm UTC](https://forum.mautic.org/t/handle-form-data-before-send/9744/1 "2017-10-19T20:41:42Z")

</div>

Hello.  
  
  
  
I am showing a form by the manual way (HTML form + Javascript). I need to change some data before sending… But how can I do that?  
  
  
  
I can execute some action after form validate and before send **(that’s what I want – OK)** , but I don’t know how to change some parameter.  
  
  
  
For example, I want to change the value of my input named

Code:

inputName

on my form

Code:

formName

. Right now, that's what I am doing:  

Code:

if (typeof MauticFormCallback == 'undefined') { var MauticFormCallback = {}; } MauticFormCallback['formName'] = { onValidateEnd: function (formValid) { var data = { 'inputName': 'New value!' }; } };

  
[(onValidateEnd documentation)](https://developer.mautic.org/?php#onvalidateend(formvalid))  
  
The

Code:

var data = {}

is just a guess, I don't know how I should determinate the new value and I can't find anything similar on Docs.  
  
Thank you.

---

<div class="post-metadata">

### Author: ![hmaesta](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@hmaesta](https://forum.mautic.org/u/hmaesta)
#### Post date: [October 19, 2017, 8:41pm UTC](https://forum.mautic.org/t/handle-form-data-before-send/9744/2 "2017-10-19T20:41:42Z")

</div>

Hello.

I am showing a form by the manual way (HTML form + Javascript). I need to change some data before sending… But how can I do that?

I can execute some action after form validate and before send (that’s what I want – OK) , but I don’t know how to change some parameter.

For example, I want to change the value of my input named `inputName` on my form `formName`. Right now, that’s what I am doing:

`if (typeof MauticFormCallback == 'undefined') {
            var MauticFormCallback = {};
        }
        MauticFormCallback['formName'] = {
            onValidateEnd: function (formValid) {
                var data = { 'inputName': 'New value!' };
            }
        };`

[(onValidateEnd documentation)](https://developer.mautic.org/?php#onvalidateend(formvalid))

The `var data = {}` is just a guess, I don’t know how I should determinate the new value and I can’t find anything similar on Docs.

Thank you.
