|
-
Oct 4th, 2006, 02:55 AM
#1
Thread Starter
Addicted Member
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!
-
Oct 5th, 2006, 05:31 AM
#2
Re: javascript + atlas problem
What is it that your Atlas code does?
-
Oct 5th, 2006, 09:10 AM
#3
Thread Starter
Addicted Member
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
-
Oct 5th, 2006, 04:10 PM
#4
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().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|