Get input value with Jquery and add it to form action before post it

Get input value with Jquery and add it to form action before post it

I tried already on stackoverflow - no answer :(.
I have unknown many Forms and unknown many different values on my site. Thats why i would send all necessary data over the action and use it with  $_GET['up']
I have an input field wich i would send with my form too (value is given by the user).

How can I get this value with jquery and add this to my action ?

I tried already like above, but got errors like "Jquery not defined" or " Unexpected token <"   ... I´m very bad with jquery, sorry.
  1. <form action="/de/site.html/index.php?up='.$sell['Name'].','.$sell['street'].',1,<script>$(\'.'.$a.'months1\').html(months)</script>" name="'.$a.'product_update1" method="post">
  2.     + m: 
  3.     <input id="months'.$a.'p1" class="update_product" name="'.$a.'months1" value="1">
  4.     <button class="delete_product" name="'.$a.'update1" type="submit"><i class="fa fa-pencil"></i></button>
  5.     </form><br/>
  6.     <script type="text/javscript">var months = $(\'#months'.$a.'p1\').val();</scripts>