I am trying to return the "value" variable to use on another function but it says that the "getData" is not defined

```js
$('form').submit(function getForm(e){
        e.preventDefault();
        var value = $(this).data('test');
        return value;
    });

    fromForm = getForm();

    function alertForm(){
        alert(fromForm);
    }
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form data-test="1">
    <input type="text"/>
    <input type="submit" />
</form>
<form data-test="2">
    <input type="text"/>
    <input type="submit" />
</form>
```