-1

I am using simple radio button form to pass parameter "mode" to "script.php". How can I pass additional custom parameters when I click "submit" button?

<form action="./script.php">
<p>2) Select mode:</p>
<input type="radio" name="mode" value="maps">full<br>
<input type="radio" name="mode" value="backup">partial<br> 
<p></p>
<input type="submit" value="Decrypt">
</form>
jurij
  • 383
  • 3
  • 7
  • 21

1 Answers1

1

You should take <input type="hidden" name="parameter_name" value="your_custom_value"> to pass additional parameter value inside form

And completely your form will be like this...

<form action="./script.php">
<p>2) Select mode:</p>
<input type="hidden" name="parameter_name"  value="your_custom_value">
<input type="radio" name="mode" value="maps">full<br>
<input type="radio" name="mode" value="backup">partial<br> 
<p></p>
<input type="submit" value="Decrypt">
</form>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
  • Thanks, that answers my question! If I may expand question - the page where this runs also has upload script. I want to pass uploaded file's name as this additional parameter. How can I take variable containing file name (in php) and pass it in this html script? Thanks! – jurij Nov 09 '19 at 19:17