Forum Moderators: open
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.
Here is one of the pages:
[calbaptist.edu...]
Notice that the search button works, but I cannot type a search term and press the Enter key.
Your assistance is greatly appreciated.
.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>
Then, you need the ClickButton javascript code:
function clickButton(e, buttonid){
var bt = document.getElementById(buttonid);
if (typeof bt == 'object'){
if(navigator.appName.indexOf("Netscape")>(-1)){
if (e.keyCode == 13){
bt.click();
return false;
}
}
if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){
if (event.keyCode == 13){
bt.click();
return false;
} } } }
And you're done. Hitting enter inside the box will now submit the form like someone clicked the Go! button.
Chip-