Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hey guys m working on a students project and i want code for " there is a search box . when we enter text in it and push the search button it must open a new tab where the main page with another search box will be there and the search text will be copied from previous search box and it must show the results of the entered text."
This is the search page
HTML
<head>
        <title>Untitled Document</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <script type="text/javascript">
            function submitSearch() {
                alert(document.getElementById('searchString').value);
                document.cookie = escape(document.getElementById('searchString').value);
                
                window.open("http://localhost:8080/GPS_Integration/test/test1.html");
                
            }

        </script>

    </head>

    <body>
        <table>
            <tr>
                <td width="140"><input type="text" name="searchString" id="searchString" class="smallFont" style="width: 135px;" /></td> 
                <td width="25" align="right"><input type="submit" name="searchButton" id="searchButton" onclick="submitSearch()" /></td>
            </tr>
        </table> 

    </body>





This is the next page which opens ...but it doesnt show the results..
HTML
<head>
<script type="javascript">
 function getcookie()
            {
                var cookie = unescape(document.cookie);
                document.getElementById("pac-input").value = cookie;
            }

</script>
</head>
<body  önload="getcookie();">

    <table>
            <tr>
                <td width="140"><input type="text" name="searchString" id="searchString" class="smallFont" style="width: 135px;" /></td> 
                <td width="25" align="right"><input type="submit" name="searchButton" id="searchButton"  /></td>
            </tr>
        </table> 


</body>
Posted
Updated 9-Mar-14 20:04pm
v2
Comments
Sergey Alexandrovich Kryukov 10-Mar-14 1:32am    
Not a question.
—SA
SoMad 10-Mar-14 1:44am    
What have you tried? Where are you stuck?

Soren Madsen
Samrat Pyaraka 10-Mar-14 1:47am    
i passed the parameters to new pages search box but its not showing the results...actually m working on google maps....i have a page where i just have a search box where ever we search it must open a new page showing the address

1 solution

Pass the parameters on the URL. Then, tell us exactly what goes wrong ( does the code not find the parameters, does it not search properly, etc )
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900