javascript + atlas problem
I have a javascript code to stop the backspace to go 'BACK'
my code:
Code:
<script type="text/javascript">
if (typeof window.event == 'undefined'){
document.onkeypress = function(e){
var test_var=e.target.nodeName.toUpperCase();
if (e.target.type) var test_type=e.target.type.toUpperCase();
if ((test_var == 'INPUT' && test_type == 'TEXT') || test_var == 'TEXTAREA'){
return e.keyCode;
}else if (e.keyCode == 8){
e.preventDefault();
}
}
}else{
document.onkeydown = function(){
var test_var=event.srcElement.tagName.toUpperCase();
if (event.srcElement.type) var test_type=event.srcElement.type.toUpperCase();
if ((test_var == 'INPUT' && test_type == 'TEXT') || test_var == 'TEXTAREA'){
return event.keyCode;
}else if (event.keyCode == 8){
event.returnValue=false;
}
}
}
</script>
when I add this code to a page use atlas the atlas dont work.
what the problem?
or there is any way to fix it.
thanks!
Re: javascript + atlas problem
What is it that your Atlas code does?
Re: javascript + atlas problem
my atlas is very basic code:
Code:
<atlas:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ....>
</asp:GridView>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="fName" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="lName" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="tz" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="birthDate" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="address" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="tel" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="cell" EventName="TextChanged" />
<atlas:ControlEventTrigger ControlID="email" EventName="TextChanged" />
</Triggers>
</atlas:UpdatePanel>
it work excellent without the javascript code that I wrote,
and it doesnt work with the js.
thanks
Re: javascript + atlas problem
It seems that all the keypress events are being captured and 'canceled' by that javascript code you have there. After all the 'if' checks in that javascript, call an alert().