473,763 Members | 6,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Focus method

Hi,

i want set focus element with element.focus()
but i have always this exception: "focus() is not a function"

Can you help me?

Thanks
I use Mozilla

stefano
Jul 20 '05 #1
5 1643


Stefano wrote:
i want set focus element with element.focus()
but i have always this exception: "focus() is not a function"

Can you help me? I use Mozilla

What kind of element is that? It should work for form controls (input,
textarea, select).
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
focus est une méthode
GR

Stefano a écrit:
Hi,

i want set focus element with element.focus()
but i have always this exception: "focus() is not a function"

Can you help me?

Thanks
I use Mozilla

stefano


Jul 20 '05 #3
Martin Honnen <ma*******@yaho o.de> wrote in message news:<40******* *@olaf.komtel.n et>...
Stefano wrote:
i want set focus element with element.focus()
but i have always this exception: "focus() is not a function"

Can you help me?

I use Mozilla

What kind of element is that? It should work for form controls (input,
textarea, select).


paragraph, inline object (bold,italic... ), i think that these elements
aren't supported by focus().
Is it true?

thanks
Jul 20 '05 #4


Stefano wrote:
i want set focus element with element.focus()
but i have always this exception: "focus() is not a function"


I use Mozilla

What kind of element is that? It should work for form controls (input,
textarea, select).

paragraph, inline object (bold,italic... ), i think that these elements
aren't supported by focus().
Is it true?


Well, a paragraph element in a normal HTML document can't have focus,
neither by user action nor by script.
Or are you having an editable iframe?
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #5
Martin Honnen <ma*******@yaho o.de> wrote in message news:<40******* *@olaf.komtel.n et>...
Stefano wrote:
i want set focus element with element.focus()
but i have always this exception: "focus() is not a function"

I use Mozilla
What kind of element is that? It should work for form controls (input,
textarea, select).

paragraph, inline object (bold,italic... ), i think that these elements
aren't supported by focus().
Is it true?


Well, a paragraph element in a normal HTML document can't have focus,
neither by user action nor by script.
Or are you having an editable iframe?


Yes, i have an editable iframe, i am writting an wysawyg editor
but i don't use "ExecComman d". I want that if user clicks "bold"
button of editor (for example), my editor inserts or removes an
element "B".
My problem is: How can i do for insert an element ? i have tried with
range.insertNod e(newc) but newc is empty (because user is writting)
and doesn't insert in a DOM.
Excusme for my English...
Thank for your help.
Stefano
Jul 20 '05 #6

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

Similar topics

7
9948
by: Phl | last post by:
hi, I can use the following code to set focus to standard html elements but if I try to do the same for a custom element, it seems to complain that it does not support a focus method. Does anyone know what is the problem, if there is a work around? thank you
31
2849
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page www.any.xy an setting the focus to "extern". But when I go return to "main" without closing "extern", a click to an other link (e.g. www.2nd_any.xy) on "main" does not setting the focus to "extern".
3
3051
by: bradwiseathome | last post by:
I focus on controls in a web form like this: <script language="javascript"> var focusControl = null; if (document.getElementById) focusControl = document.getElementById('txtArea1'); else if (document.all) focusControl = document.all; if (focusControl && focusControl.focus) focusControl.focus();
3
6897
by: VA | last post by:
t=document.getElementById('mytable') is a HTML table with some input fields in its cells Why doesnt t.getElementsByTagName('tr').firstChild.focus; put the focus on that text field? It doesnt give any errors, the focus just doesnt change.
2
2016
by: Jesper | last post by:
Last week I posted this for the first time. However, I didn't get any useable solution to my problem. I'm very keen on getting this problem solved, so please excuse me for trying again. I'll try to be a little more precise. I have an app running (minimized) and without showing itself on the task bar. It puts an icon in the task pane (next to the clock), and when I click this icon, a message handler is invoked and creates a new usercontrol...
18
2448
by: Euphor2 | last post by:
I'm in school, taking a VB .NET 2003 course, and the teacher taught us how to use Sender.Focus() to return focus to the control from which focus was received. However, when I got home, and tried it on my own copy of VB .NET 2003, it doesn't seem to work, in fact the only method that comes up with Intellisense is GetType. I can't find any information anywhere either in the MSDN Library, or anywhere else for that matter. I was hoping...
1
2515
by: Praveena.Alapati | last post by:
Hi, There is a tab control on a page with multiple tabs and handful of controls in each tab. The way it's rendered in html (like grid etc..) is in table format in tablerows and cells. On clientside, on form validation in javascript, I would like to set focus on to one of the tabs and set the focus to the control on that tab.
9
18020
by: Zytan | last post by:
http://msdn2.microsoft.com/en-us/system.windows.forms.control.focus(VS.80).aspx this page says: "Focus is a low-level method intended primarily for custom control authors. Instead, application programmers should use the Select method or the ActiveControl property for child controls, or the Activate method for forms." I am trying to give a Numeric UpDown control focus. Only Focus() works. But this says to not use it.
4
68048
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between these forms that may make one succeed and another fail? In particular, this.window.focus() fails in Opera 9.10 with an "object not found", and windows.focus() succeeds in Opera 9.10, Firefox 2.02, and IE 7.
0
9387
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
10002
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
9938
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
9823
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
8822
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
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
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
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.