Create an auto-populate dynamic link URL based on user info in an input field

I’m trying to make a text input field where visitors can enter a value and then hit go or submit., and based on the input value they would be send to a new page with the information from the input field already populated.

For example if they type in 12345 as a zip code in the input field, we want them to be directed to

And it would pull up in a separate window with the zip code field already populated in the embedded link.

I have tried this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" >
    <title>Untitled Page</title>
<script type="text/javascript" src=""></script>

<script type="text/javascript">


    $('#button').click(function(e) {  
        var inputvalue = $(“#z”).val();


       <input type="text" id=“z”> 
       <button type="button" id="button">Click Me!</button>

However it still will not auto-populate based on the input field information.

Could anybody please help me get this up and running? Thank you


You can use template string to inject the value of inputvalue into the string of the url.
Then use in order to open the page in a new window.


    $('#button').click(function(e) {  
        var inputvalue = $("#z").val(); 
        var url = `${inputvalue}&ct=residential`; 



<input type="text" id="z"> 
<button type="button" id="button">Click Me!</button>