There are several input

 <input type="number" class="amount_int" name="amount" value=""/> <input type="radio" class='radio-button' name="amount" value="1.00" id="sem3"> <input type="radio" class='radio-button' name="amount" value="5.00" id="sem"> <input type="radio" class='radio-button' name="amount" value="10.00" id="sem2"> 

The fact is that for the correct work of the paper, there must be one input with name = "amount", so you need an additional input called the amount, but how can you transfer the value to it?

  • well, so remove these inputs and that's it. How to transfer value? A million ways, the user himself can not enter? Or js'om enter. - Jean-Claude
  • Well, it was not I who invented it, but I have to do it) there must be ready-made options 1, 5, 10, + so that you can enter it manually - Alexander Reizan

2 answers 2

The easiest option is to leave one meaningful input, and for others, one way or another, to process the onClick value.

Handling input I do not cite. The question is not in it.

  <input id="amount_val" type="number" class="amount_int" name="amount" value="" /> <br /><span><input type="radio" value = "1.00" name="amount-tmp" onclick= "javascript:document.getElementById('amount_val').value=this.value;"> 1.0</span> <br /><span><input type="radio" value = "5.00" name="amount-tmp" onclick= "javascript:document.getElementById('amount_val').value=this.value;"> 5.0</span> <br /><span><input type="radio" value = "10.00" name="amount-tmp" onclick= "javascript:document.getElementById('amount_val').value=this.value;"> 10.0</span> 

  • Brrrrrr .. label ? javascript: :? - Qwertiy
  • @Qwertiy, noted in the first comment - options million. - Yevgeny Borisov

jQuery

Here is an example:

 $(document).ready(function(){ $("button").click(function(){ $("input:text").val("Glenn Quagmire"); }); }); 
 <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> </head> <body> <p>Name: <input type="text" name="user"></p> <button>Set the value of the input field</button> </body> </html>