HTML FORM + pureJS Auto multiply script

I have a simplified HTML form that I would like to multiply entered amount by 100 and send it with GET method to any endpoint.

Here is my form:

    <form method="get" action="https://endpoint/purchase.php">
        <input type="text" name="description" value="description">
    <input type="text" name="amount">
    <input type="submit" value="pay">

And my Js

var $output = $("#output-value");
$("#input-value").keyup(function() {
    var value = parseFloat($(this).val());

I’m stuck here, as I don’t know how to connect them to send a proper value where I want?

Thank You. That helps a lot, I have another problem, where, in which the URL passed in GET is shortened / cut out?

So below is an original URL

I would like to be able to dynamiclly trnasfer z24_kwota (/z24_amount) so my form can transfer the amount as I want.
After tweaking the code above to my needs:

<meta charset="utf-8">
<title>Formularz uproszczony</title>


    <script src="">
<form id="testForm" method="get" action="">
  <input type="text" name="z24_kwota" value="Kwota">
  <input type="submit" value="zapłać ">
        $("#testForm").on('submit', function() {
  var amount = $("#testForm input[name='z24_kwota']")
  var value = parseFloat(amount.val());
  value = value * 100 || 0; // set zero for non number

  if (prompt("Kwota przekazywana do Przelewy24 to: ", value)) {
    return true
  else {
    console.log('submission aborted, value not multiplied')
    return false;


I see that only first part is in the browser adress bar:
Can someone tell me why that is, and how to fix it ?

18 thoughts on “HTML FORM + pureJS Auto multiply script”

Leave a Comment