Hello -
I'm having an issue where I'm trying to capture the "enter" keypress event and triggering the callback panel event for a button. Basically, the form always performs a postback even though I've captured the Enter key event. If I click the aspxButton the form behaves as expected. It validates the fields and displays appropriate messages. When the Enter Key is pressed, it validates the fields then appears to do a postback clearing out the messages. Thanks.
////aspxRoundPanel:////
<dxrp:ASPxRoundPanel ID="pnlLogin" runat="server" Width="450px" Height="200px" DefaultButton="btnLogin" ShowHeader="False" HorizontalAlign="Center" ClientInstanceName="clLogin" EnableClientSideAPI="True">
////aspxButton/////
<dxe:ASPxButton ID="btnLogin" UseSubmitBehavior="false" CausesValidation="true" runat="server" Text="Log In" ClientInstanceName="btnLogin" EnableClientSideAPI="True" AutoPostBack="False" Height="26px" Width="76px" CssFilePath="~/App_Themes/Glass/{0}/styles.css" CssPostfix="Glass" Cursor="pointer">
<ClientSideEvents Click="function(s, e) {
if(ASPxClientEdit.ValidateGroup('entryGroup')) {
CallbackPanel.PerformCallback(e);
}
}" />
<Image AlternateText="Log In" />
<Border BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
</dxe:ASPxButton>
////Here is my BLOCKED SCRIPT/////
function checkEnter(e){ //e is event object passed from function invocation
var characterCode //literal character code will be stored in this variable
if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}
if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
alert("test");
return false;
}
else{
return false;
}
}