473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP.NET 2 - TextBox control on IE 5 Mobile - onblur does not fire

Hi all,

I'm tearing my hair out on this!

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 IE 5, 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.

Can anyone save my sanity!

Cheers,

Duncan
Jun 27 '08 #1
1 2587
On 14 May, 17:03, Duncan <spence_dun...@hotmail.comwrote:
Hi all,

I'm tearing my hair out on this!

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 IE 5, 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.

Can anyone save my sanity!

Cheers,

Duncan
Some additional information that I've found from testing.

The onblur DOES work for Radio Buttons - haven't tested other controls
yet.

The onblur IS getting added as an attribute to the <input
type='text'... /control - I can see it using the getAttribute
method, and it has the correct script command attached to it.

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());
}
}

Just thought you might like to know.

Duncan
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
1
by: Stan Sainte-Rose | last post by:
Hi Is there a Leave Event textbox ? I would like to set a default value if the user doesn't fill up a textbox. Thanks Stan
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
2
by: ThunderMusic | last post by:
Hi, I have a form in which there are many <asp:textbox> tags. When I run the form, we use tab to navigate across the textboxes, but one of our client noticed that when we navigate to some readonly...
1
by: D. Shane Fowlkes | last post by:
I have a asp:textbox which I've applied a javascript function to strip off all non-numeric chanarcters. The js function is triggered with the textbox's onblur attribute. I also have a...
1
by: dan_williams | last post by:
I'm trying to create a textbox control on an asp.net web page, that after a user has typed some text into it, another pop-up window appears with a dropdownlist populated with options related to the...
5
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a...
2
by: rajkm42 | last post by:
Hi friends, I have a gridview which loads an XML file to display a textbox and other dropdownlists. Which is used for data entry. The user will enter an empid in the textbox. Once leaving the...
3
by: crjunk | last post by:
Hi Everyone, I have a web form that I would like to enhance. What I'd like to do is this: A user adds/edits the text in a textbox. I want the adjoining label to change color. Example: User...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.