473,788 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Attrib utes.Add("oncha nge",
"javascript:ale rt('Changed');" );
Response.Attrib utes.Add("onfoc us",
"javascript:ale rt('Has Focus');");
Response.Attrib utes.Add("onblu r",
"javascript:ale rt('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 2608
On 14 May, 17:03, Duncan <spence_dun...@ hotmail.comwrot e:
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.Attrib utes.Add("oncha nge",
"javascript:ale rt('Changed');" );
* * * * * * * * Response.Attrib utes.Add("onfoc us",
"javascript:ale rt('Has Focus');");
* * * * * * * * Response.Attrib utes.Add("onblu r",
"javascript:ale rt('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.getAttr ibute('onfocus' ));
alert ('onblur = ' + control.getAttr ibute('onblur') );
alert ('about to get wrongattribute' );
var attrib = control.getAttr ibute('wrongatt ribute');
alert ('got wrongattribute' );
//if (control.getAtt ribute('wrongat tribute') == null)
{
// alert ('Attribute not found');
//}
//else
//{
// alert ('wrongattribut e = ' +
control.getAttr ibute('wrongatt ribute'));
//}

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
8404
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 submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
1
3891
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
4580
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 opinion of how I want to handle the 'user experience' in the application I'm creating. While I know I could allow the user to enter in number and alpha text - in a text box - and then tell them when the execuate a command "This is not numeric data", I...
2
3091
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 textboxes, the cursor (text cursor, not mouse cursor) disapears and when we tab to the next textbox and come back (shift-tab), not it's ok. Notice that when we navigate to each textbox, the text is automaticaly selected which is not the case for...
1
3142
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 rangevalidator to make sure the value entered is numeric and is between 1 & 999999. The custom js works fine. If someone enters 7,777 or even something invalid like 7,7,7,7, all the commas are stripped off as soon as they tab off the field and all that is...
1
2682
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 text the user entered. My initial attempt was to create a javascript function that executes on the onblur event of my textbox. My javascript function is as follows:- function fnClient() { var tURL = "modGetClient.aspx?client=" +...
5
13963
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 TextBox I want to use a hidden button to fire when the Onclick Event is fired for the TextBox.
2
3615
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 textbox(for example after pressing tab), I need to fire Blur event of that textbox and retrieve the empname and display in the next column of the textbox in the gridview. How can I fire the blur event of textbox?
3
4865
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 edits text in txtCaseNumber. The cursor leaves txtCaseNumber. Code executes and turns lblCaseNumber text from black to red.
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.