Results 1 to 4 of 4

Thread: javascript + atlas problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    194

    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!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: javascript + atlas problem

    What is it that your Atlas code does?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    194

    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

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width