Mobile IE6 Standard ASP.NET – onblur not working for , problems with getAttribute

來源:互聯網
上載者:User

來源:http://www.imcoder.org/mobile/210544.htm

 

Q:

Hi all,

I have a simple ASP.NET 2 page with a TextBox control, in the PreRender I set ClientSide events:-

                Response.Attributes.Add("onchange", "javascript:alert('Changed');");
                Response.Attributes.Add("onfocus", "javascript:alert('Has Focus');");
                Response.Attributes.Add("onblur", "javascript:alert('Lost Focus');");

In the destop browser everything is fine, all events fire as expected.

When I open the same page from a PDA running Mobile Windows Professional 6, only the
onfocus and onchange events fire, onblur never does.

The Internet Explorer Mobile Reference page tells me that these, and only these events can be caught in the mobile browser but I can't make it work.

RadioButton controls appear to work as expected for all three events - have had a chance to test the other controls yet.

 

I can see that the attribute is appearing in the tag (using the getAttribute method) and the attached script looks fine.

 

There also appears to be a problem with the getAttribute command in general.

According to the Internet Explorer Mobile Reference the method should return a null if the attribute is not found, instead an exception is thrown, but without any details attached to the error object.

Here's the JS function that I'm using to check :-

        function findAttributes(control) {
            try {
                alert ('in findAttributes');
                //alert ('onfocus = ' + control.getAttribute('onfocus'));
                alert ('onblur = ' + control.getAttribute('onblur'));
                alert ('about to get wrongattribute');
                var attrib = control.getAttribute('wrongattribute');
                alert ('got wrongattribute');
                //if (control.getAttribute('wrongattribute') == null) {
                //    alert ('Attribute not found');
                //}
                //else
                //{
                //    alert ('wrongattribute = ' + control.getAttribute('wrongattribute'));
                //}

                controlCurrent = control;
                if (control.type == 'text')
                {
                    alert ('this is a text control');
                }
                else
                {
                    alert ('this is NOT a text control');
                }
            }
            catch(e) {
            catch(e) {
                alert ('Error - ' + e.description);
                alert ('Error - ' + e.message);
                alert ('Error - ' + e.name);
                alert ('Error - ' + e.number);
                alert ('Error - ' + e.toString());
            }
        }

Any help greatly appreciated.

 

Cheers,

 

Duncan

A:

Hello Spence,

it would be interesting to read something about the onblur issue from the IEMobile team.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.