Msg#: 3775947 posted 4:48 pm on Oct 29, 2008 (gmt 0)
I have a *.aspx Web page that uses a *.master page. The *.master page includes a Google search field. When I type in a search term and press the Enter key, the page seems to submit itself - nothing else happens. The page should forward to Google search results.
The *.master page template uses its own FORM tag. The Google search field also uses its own FORM tag. I'm pretty sure that this is causing the problem.
Msg#: 3775947 posted 5:16 pm on Oct 29, 2008 (gmt 0)
You are correct that the Google search needs its own form tag to work properly as you originally intended. A alternate solution would be to create the Google search URI in the submit button event and do a Redirect to that after the post back which should achieve the same effect.
Msg#: 3775947 posted 5:32 am on Oct 30, 2008 (gmt 0)
.net: q.Attributes.Add("onkeypress", "return clickButton(event, '" & btnSearch.ClientID & "')") Where 'q' is the ID of your <asp:textbox> and btnSearch is the id of your <asp:Button>
And you're done. Hitting enter inside the box will now submit the form like someone clicked the Go! button.