JSFiddle - React, Tailwind, and code Playground

HTML

<FORM METHOD="POST" ACTION="www.google.com" onSubmit="return buildURL(this);"> 
<input type="text" name="last"> 
<input type="text" name="first"> 
<input type="hidden" name="redirect" value="">
<input type="SUBMIT" name="submitButton" value="Submit">

JavaScript

function buildURL(form) { 
 form.redirect.value='http://www.google.com/?'+last +first; 
 form.action='http://www.google.com/?'; 
 // Comment the alert and uncomment the form.submit() line 
 //alert('form will be posted to ' + form.action + ' redirect: ' + form.redirect.value); 
// form.submit(); 
 }