How can I get a variable within a form script before the form is submited?

Hello all,

I have an embedded form, in which I have a text input field that binds to a process variable named “customerID”.

I want to fetch this variable inside a form script, before the form is submitted.

<input type="text" cam-variable-name="customerID" cam-variable-type="String" />

<script cam-script type="text/form-script">
    var variableManager=camForm.variableManager;
    camForm.on("submit",function(evt){
            //how can I get the value of the above text field ??
   })
</script>

So, how can I get the value of the variable customerID inside the camForm.on () ?

Thank you in advance.

@nikolaosnousias take a look at this example:

It shows how to capture some variables.

Any specific reason why you want to get this value before the submission instead of when the form loads (using the variable manager) ?