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:

<body>
    <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">
    </form>
</body> 

And my Js

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

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

https://sklep.przelewy24.pl/zakup.php?z24_id_sprzedawcy=88696&z24_kwota=10000&z24_currency=pln&z24_nazwa=test&z24_opis=test&z24_return_url=http%3A%2F%2Fwww.przelewy24.pl&z24_language=pl&k24_kraj=PL&z24_crc=ca056736&

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:

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

<body>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js">
    
    </script>
<form id="testForm" method="get" action="https://sklep.przelewy24.pl/zakup.php?z24_id_sprzedawcy=88696&z24_currency=pln&z24_nazwa=test&z24_opis=test&z24_return_url=http%3A%2F%2Fwww.przelewy24.pl&z24_language=pl&k24_kraj=PL&z24_crc=ca056736&">
  <input type="text" name="z24_kwota" value="Kwota">
  
  <input type="submit" value="zapłać ">
  <script>
        $("#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)) {
    amount.val(value);
    return true
  } 
  else {
    console.log('submission aborted, value not multiplied')
    return false;
  }

});</script>
</form>
    
</body>
</html>

I see that only first part is in the browser adress bar:
”’https://sklep.przelewy24.pl/zakup.php?z24_kwota=2000”’
Can someone tell me why that is, and how to fix it ?

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

  1. I am curious to find out what blog system you happen to
    be working with? I’m having some small security problems with my latest blog and I would like to find something
    more secure. Do you have any recommendations?

    Reply
  2. Hello very nice site!! Guy .. Excellent .. Amazing .. I will bookmark your site and take the feeds
    also? I am glad to seek out so many useful information here in the submit, we need develop extra strategies on this regard, thanks for sharing.
    . . . . .

    Reply
  3. I like the helpful information you supply on your articles.
    I’ll bookmark your blog and test once more right here frequently.
    I am quite sure I’ll be told lots of new stuff right right here!
    Best of luck for the following!

    Reply
  4. A motivating discussion is worth comment. I think that you should write
    more on this subject, it may not be a taboo subject but usually
    people do not discuss these subjects. To the next! Cheers!!

    Reply
  5. Superb blog you have here but I was wondering
    if you knew of any message boards that cover the same
    topics discussed here? I’d really like to be a part of group where I can get advice from
    other knowledgeable individuals that share the same interest.
    If you have any recommendations, please let me know. Many thanks!
    ps4 https://bitly.com/3nkdKIi ps4 games

    Reply
  6. Hey there! I know this is somewhat off topic but I was wondering which
    blog platform are you using for this site? I’m
    getting tired of WordPress because I’ve had
    problems with hackers and I’m looking at alternatives for another platform.
    I would be fantastic if you could point me in the direction of a good platform.

    Reply
  7. A fascinating discussion is definitely worth comment.

    I do believe that you should publish more on this subject, it might not be a
    taboo subject but usually folks don’t discuss such topics.
    To the next! Kind regards!!

    Reply
  8. I do agree with all of the ideas you’ve introduced on your post.
    They’re very convincing and can certainly work. Still,
    the posts are too quick for beginners. May you please lengthen them a little from subsequent time?
    Thanks for the post.

    Reply
  9. Great post. I was checking constantly this blog and I
    am impressed! Extremely useful info particularly the last part 🙂
    I care for such info a lot. I was looking for this certain info for a
    very long time. Thank you and best of luck.

    Reply
  10. Simply desire to say your article is as astonishing.
    The clearness in your post is simply cool and i can assume you are an expert on this subject.
    Well with your permission allow me to grab your feed to
    keep up to date with forthcoming post. Thanks a million and please keep up the rewarding work.

    Reply
  11. You really make it appear really easy along with
    your presentation but I find this topic to be really something that I think I might by no means understand.
    It seems too complicated and very wide for me. I’m having a look
    forward on your subsequent publish, I will attempt to get the dangle of
    it!

    Reply
  12. My brother suggested I might like this web site. He
    was entirely right. This post truly made my day. You can not imagine
    simply how much time I had spent for this information! Thanks!

    Reply
  13. I will immediately grab your rss as I can’t to find your e-mail subscription hyperlink or newsletter service.
    Do you have any? Kindly let me recognize so that I may just subscribe.
    Thanks.

    Reply
  14. Having read this I believed it was very enlightening.

    I appreciate you taking the time and effort to put this information together.
    I once again find myself spending way too much time
    both reading and posting comments. But so what, it was still worthwhile!

    Reply
  15. Heya superb blog! Does running a blog such as this take a
    massive amount work? I’ve virtually no understanding of
    computer programming however I was hoping to
    start my own blog in the near future. Anyways, should you have any recommendations
    or tips for new blog owners please share. I understand this is off topic however I simply wanted to ask.
    Thanks a lot!

    Reply
  16. This is very interesting, You are a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of
    your magnificent post. Also, I’ve shared your site in my social networks!

    Reply
  17. Hey There. I found your blog using msn. This is an extremely well written article.
    I will make sure to bookmark it and come back to read more of your useful info.
    Thanks for the post. I’ll definitely return.

    Reply

Leave a Comment