How do I get the value of an Imput HTML in twig?

Hello, I have the following problem …
I need to do a pre-validation before adding data to a selected object, the subject
is that I have to validate the input field and based on this value I must make the insertion of the various inputs.
My code is the following …

{% if! = ""%}

$ {item.keep1}

                                                                                                                {% else%}
                            {% endif%}

Many Thanks