HTML for creating search input

`<!DOCTYPE html>

<html lang=”en”>

<head>

    <meta charset=”UTF-8″>

    <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

    <title>Search Bar Example</title>

    <style>

        .search-container {

            position: absolute;

            top: 30px;

            right: 10px;

            display: flex;

            flex-direction: column;

            align-items: flex-end;

            z-index: 9999;

        }

        .search-bar {

            padding: 5px;

            width: 200px;

            font-size: 12px;

            border-radius: 8px;

            margin-bottom: 10px;

        }

        button {

            background-color: #0099ff;

            color: white;

            border: none;

            border-radius: 10%;

            padding: 5px;

            font-size: 12px;

            cursor: pointer;

            box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);

            transition: background-color 0.3s;

            margin-bottom: 10px;

        }

        button:hover {

            background-color: #0066ff;

        }

    </style>

    <script>

        function redirectToList(type) {

            var searchQuery;

            var url;

            switch(type) {

                case ‘po’:

                    searchQuery = document.getElementById(“search-po”).value;

                    if (searchQuery) {

                        url = “https://6714807-sb1.extforms.netsuite.com/app/site/hosting/scriptlet.nl?script=1974&deploy=1&compid=6714807_SB1&h=fa18a61bd87dbd85d18f&poid=” + searchQuery;

                    }

                    break;

                case ‘bill’:

                    searchQuery = document.getElementById(“search-bill”).value;

                    if (searchQuery) {

                        url = “https://6714807-sb1.extforms.netsuite.com/app/site/hosting/scriptlet.nl?script=1974&deploy=1&compid=6714807_SB1&h=fa18a61bd87dbd85d18f&billid=” + searchQuery;

                    }

                    break;

                case ‘awb’:

                    searchQuery = document.getElementById(“search-awb”).value;

                    if (searchQuery) {

                        url = “https://6714807-sb1.extforms.netsuite.com/app/site/hosting/scriptlet.nl?script=1974&deploy=1&compid=6714807_SB1&h=fa18a61bd87dbd85d18f&awbid=” + searchQuery;

                    }

                    break;

            }

            if (url) {

                window.location.href = url;

            }

        }

    </script>

</head>

<body>

    <div class=”search-container”>

        <div>

            <input type=”text” id=”search-po” class=”search-bar” placeholder=”Enter PO Number”>

            <button type=”button” onclick=”redirectToList(‘po’)”>Search PO</button>

        </div>

        <div>

            <input type=”text” id=”search-bill” class=”search-bar” placeholder=”Enter Bill Number”>

            <button type=”button” onclick=”redirectToList(‘bill’)”>Search Bill</button>

        </div>

        <div>

            <input type=”text” id=”search-awb” class=”search-bar” placeholder=”Enter AWB Number”>

            <button type=”button” onclick=”redirectToList(‘awb’)”>Search AWB</button>

        </div>

    </div>

</body>

</html>

Leave a comment

Your email address will not be published. Required fields are marked *