How to combine two input fields and open as URL for different URL combination?

How to combine two input fields and open as URL for different URL combination?

two submit buttons in one form different action
two submit buttons in one form different action javascript
multiple form actions with one submit button
how to handle multiple submit buttons in html forms
formaction
html formaction
submit form to two different pages
two submit buttons in one form flask

My website customer frequently looking tracking details, every time they need to go different types courier website and enter tracking id.

All my courier websites tracking url position same, 1) courier website 2) id

eg: (More than one courier service and their respective tracking URL)

1) www.courier.com?trackingid=12345

2) www.courier.in/track/id=1234&type=0&service=0

How to merge two input fields.

eg:

Code :

<!DOCTYPE HTML>
<html>
<body>
    <form action="#" method="post">
        Select Courier :
        <select name="courier">
            <option value="">--Please choose an option--</option>
            <option value="professional_courier">Professional Courier</option>
            <option value="india_post">India Post</option>
        </select>

        Trackingid: <input type="text" name="trackingid"><br>
        <input type="submit">

    </form>
    <?php
    ini_set('display_startup_errors', 1);
    ini_set('display_errors', 1);
    error_reporting(-1);

    // if (!empty($_POST)): header("Location: https://www.tpcindia.com/Tracking2014.aspx?id=".$_POST["trackingid"]."&type=0&service=0");
    // endif;


    if (!empty($_POST['courier']) && !empty($_POST['trackingid'])) {
        switch ($_POST['courier']) {
            case 'professional_courier':
                $url = "https://www.tpcindia.com/Tracking2014.aspx?id=".$_POST["trackingid"]."&type=0&service=0";
                break;
            case 'india_post':
                $url = "https://www.indiapost.gov.in/_layouts/15/dop.portal.tracking/trackconsignment.aspx";
                break;
            default:
                throw new RuntimeException(sprintf('Unknown courier "%s"', $_POST['courier']));

                header('Location: ' . $url);
        };
    };
    ?>

</body>

</html>

Not working. for single url its working(see below working code),

<!DOCTYPE HTML>
<html>  
<body>

<form action="#" method="post">
Select Courier :
<select name="courier">
  <option value="">--Please choose an option--</option>
  <option value="professional_courier">Professional Courier</option>
  <option value="india_post">India Post</option>
</select>

Trackingid: <input type="text" name="trackingid"><br>
<input type="submit">

</form>



<?php 
if (!empty($_POST)): header("Location: https://www.tpcindia.com/Tracking2014.aspx?id=".$_POST["trackingid"]."&type=0&service=0");
endif;

?>
</body>
</html>

jQuery solution:

$( "#button" ).click(function() {
  var x = $('#select1').val();
  var y =  $('#select2').val();
  window.location.href = 'https://www.' + x + '.com?trackingid=' + y;
});

Separate Form Submit Buttons That Go To Different URLs, When you submit that form, it's going to go to the URL `/submit`. Say you need another submit button that submits to a different URL. It doesn't� To add a merge field to your survey URL - you’ll append a few things to the end of the URL. Start with a '?' symbol to separate the survey ID from the merge fields. Then you’ll add your merge field name, an '=' symbol, and the merge field value. In this example the merge field name is ContactID and the merge field value is 12345.


Hey it is very simple can check this example with PHP code user header location and pass your tracking after post

<!DOCTYPE HTML>
<html>  
<body>

<form action="#" method="post">

<select name="cm_id">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

Trackingid: <input type="text" name="trackingid"><br>
<input type="submit">

</form>

<?php if (!empty($_POST)): header("Location: http://localhost/test.php?trackingid=".$_POST["trackingid"]); endif;?>

</body>
</html>

Field merge examples, An image of the landing page editor with the Field Merge Browser open. When working with the combination of field merges and URLs, it's important to remember that field Example: Adding a hidden query string field merge to a form. That's a middle string 'URL' to link to 2nd url. Use concatenate to any combination of strings (256 max). =CONCATENATE (url1, "URL", url2) Take problems as inputs!


I assume you using jQuery and this is your html form

<form action="#">
  <select name="courier" id="courier">
    <option value="www.abc.com">ABC</option>
    <option value="www.xyz.com">XYZ</option>
  </select>
  <input type="text" name="tracknumber" id="tracknumber">
  <input type="button" id="submit" value="submit">
</form>

To handle what you expect, use on click event jquery

$('#submit').click(function(){
  var courier = $('#courier').val();
  var tracknumber = $('#tracknumber').val();
  window.open(courier+'?trackingid='+tracknumber, '_blank');
});

This is the complete code with multiple courier.

<html>
<head>
    <title>Courier Tracking</title>
    <script
 src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
 integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8="
 crossorigin="anonymous"></script>
</head>
<body>
    <form action="#">
        <select name="courier" id="courier" multiple>
            <option value="http://example.com">ABC</option>
            <option value="http://example2.com">XYZ</option>
        </select>

        <input type="text" name="tracknumber" id="tracknumber">
        <input type="button" id="submit" value="submit">
    </form>
</body>
        <script type="text/javascript">

        $('#submit').click(function()
        {
            var courier = $('#courier').val();
            var tracknumber = $('#tracknumber').val();
            $.each(courier, function( index, value ) {
                  window.open(value+'?id='+tracknumber, '_blank');
                });
        });
    </script>
</html>

HTML 5.2: 4.10. Forms, Multiple controls can have the same name; for example, here we give all the Choosing between different values of this attribute is the same choice as choosing whether url, URL, An absolute URL, A text field or combo box When a textarea element is popped off the stack of open elements of an HTML� Multiple URLs - QR Code, Many URLs into one image: Free QR Code Generator: No registration, no restrictions and no expiring, even for commercial use. You can make shortened QR codes, dynamic QR codes, and more than 15 types of functional QR codes.


Finally working, thanks to everyone.

<!DOCTYPE HTML>
<html>

<body>

    <form action="#" method="POST">
        Select Courier :
        <select name="courier">
            <option value="">--Please choose an option--</option>
            <option value="professional_courier">Professional Courier</option>
            <option value="india_post">India Post</option>
        </select>

        Trackingid: <input type="text" name="trackingid">
        <input type="submit">

    </form>

    <?php
    if (isset($_POST['courier'])) {
        if ('professional_courier' === $_POST['courier']) {
            header("Location: https://www.tpcindia.com/Tracking2014.aspx?id=" . $_POST["trackingid"] . "&type=0&service=0");
        } else if ('india_post' === $_POST['courier']) {
            header("Location: https://www.dhl.com/en/express/tracking.html?AWB=" . $_POST["trackingid"] . "&brand=DHL");
        }
    }
    ?>
</body>

</html>

How to Automatically Pass Form Data to Another Form, We know how to prepopulate a JotForm Form via URL parameters as Step 2 - The two forms are identical and we are showing different input fields, this is to Click the GEAR icon to open the Properties Wizard. 2. I only want to merge data from Form 1 to the 2nd PDF under the appropriate month. Combine data with the Ampersand symbol (&) Select the cell where you want to put the combined data. Type = and select the first cell you want to combine. Type & and use quotation marks with a space enclosed.


2 URLs and HTTP, To access the text of a document from the web, first obtain its URL as a string. have a regular input port with which to process the document, as with any other file. the result of (string->url "http://racket-lang.org/a/") has a path field with strings "a" the two and returns a new URL as per the URL combination specification. Select and copy the column with the URLs, then paste into a new column to the right of existing columns. Highlight this new column, click the Data tab, and in the Data Tools, click Convert Text to Columns wizard. In the Wizard, choose Delimited, and click Next. In the next page of the Wizard, uncheck Tab and chose Other.


Combine strings together in multiple ways, Ruby method that combined a person's name with the text "says hello" for a result Combining two or more strings together in Ruby can be as simple as One other way to combining multiple strings together involves more of For example, say that you have text prompting a user to update their profile. This way you can merge more than two different websites and generate a common link for them. In other words, it creates a bundle of URLs, which can be used whenever you need to share a group of


Combining Cell Values - OpenRefine, A free, open source, powerful tool for working with messy data. OpenRefine 3.3 allows to combine information from multiple columns. specific string or characters to a column's values, or a combination of both. A pop-up window will appear with several sections, including a GREL expression input box� Add the directors metadata file to the Job as the second source input. 3. Add and configure a tMap component to join the two source components. Add a tMap component to the Job Designer. To establish a flow of data between the two components to the tMap component, first link movies to the tMap_1 component, and then link directors to the tMap_1.