473,395 Members | 1,578 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,395 software developers and data experts.

Firefox custom properties problem

Hi, I'm trying find a solution to display a contextual helptext when mouse
enters a form element (IE6 and Firefox 1.0)

The input tag :
<input name="message.title" helptext="Help message" value="" size=80>

The code :

var e = document.mainform.elements;
for(i=0;i<e.length;i++)
{
var formObject = e[i];

if(formObject.helptext != null)
{
formObject.onmouseover=mouseOverHandler;
formObject.onmouseout=mouseOutHandler;
}
}
The above code works under IE6 but not with Firefox, nothing happen because
formObject.helptext is undefined.
What's wrong ? Does Firefox not support custom properties ?
Thanks

Jul 23 '05 #1
2 3865
"Zouplaz" <po***@pouet.com> wrote in message
news:Xn********************@212.27.42.77...
Hi, I'm trying find a solution to display a contextual helptext when
mouse
enters a form element (IE6 and Firefox 1.0)

The input tag :
<input name="message.title" helptext="Help message" value="" size=80>

The code :

var e = document.mainform.elements;
for(i=0;i<e.length;i++)
{
var formObject = e[i];

if(formObject.helptext != null)
{
formObject.onmouseover=mouseOverHandler;
formObject.onmouseout=mouseOutHandler;
}
}
The above code works under IE6 but not with Firefox, nothing happen
because
formObject.helptext is undefined.
What's wrong ? Does Firefox not support custom properties ?


By doing what you are doing, you've created markup that won't validate.
But ignoring that for now:

<form name="mainform">
<input name="message.title" helptext="Help message" value="" size=80>
</form>
<script type="text/javascript">
var e = document;
if ((e = e.forms) && (e = e.mainform) && (e = e.elements))
{

for (i = 0; i < e.length; i++)
{
var ctl = e[i];
if (ctl.getAttribute && ctl.getAttribute('helptext'))
{
ctl.onmouseover=function() { alert('Over: ' +
ctl.getAttribute('helptext')); };
ctl.onmouseout=function() { alert('Out: ' +
ctl.getAttribute('helptext')); };
}
}
}
</script>

Tested and working in IE 6.0.2900, Firefox 1.0, Opera 7.54u2, Mozilla
1.0.2 and Mozilla 1.7.5.

Note that Mozilla 1.0.2 only fires the onmouseover, the other browsers
seem to fire both events moving over and out.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Grant Wagner - gw*****@agricoreunited.com :

By doing what you are doing, you've created markup that won't validate.
But ignoring that for now:

<form name="mainform">
<input name="message.title" helptext="Help message" value="" size=80>
</form>
<script type="text/javascript">
var e = document;
if ((e = e.forms) && (e = e.mainform) && (e = e.elements))
{

for (i = 0; i < e.length; i++)
{
var ctl = e[i];
if (ctl.getAttribute && ctl.getAttribute('helptext'))
{
ctl.onmouseover=function() { alert('Over: ' +
ctl.getAttribute('helptext')); };
ctl.onmouseout=function() { alert('Out: ' +
ctl.getAttribute('helptext')); };
}
}
}
</script>

Tested and working in IE 6.0.2900, Firefox 1.0, Opera 7.54u2, Mozilla
1.0.2 and Mozilla 1.7.5.

Note that Mozilla 1.0.2 only fires the onmouseover, the other browsers
seem to fire both events moving over and out.


Thanks a lot for your answer, I'll try it today !
Jul 23 '05 #3

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

Similar topics

4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
13
by: rbronson1976 | last post by:
Hi all, I have a very simple page that Firefox has problems with: www.absolutejava.com/testing.htm First of all, this page seems to be perfectly valid XHTML Strict. Both the W3C validator as...
0
by: Pavan | last post by:
My name is Pavan and I am a software engineer working on ASP .Net web development. Currently I am using .Net 2.0 Professional Edition to develop my web pages. I have a problem
1
by: dasayu | last post by:
Hi, I have a custom object called gridWidget. I am consistantly getting an error in FireFox when I click on an href, which calls a function defined on the object. The generated link looks similar...
10
by: Alan Silver | last post by:
Hello, In my (seemingly) endless quest to understand CSS, I have yet another problem. Please look at http://www.kidsinaction.org.uk/ph/x.html in Opera, where you will see it how I expected. If...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
5
by: Prasad | last post by:
Hi all, I wanted to know whether my page is connecting to server or not using xmlHttp request. For that , I am using one condition in onreadystatechange function as.. function xxx() {...
6
by: scotty | last post by:
I have a script that loops through an existing table list and prepares each href element node to trigger a function when an image is clicked. The function that will be run passes a property value...
3
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
Hi, I think this is a relatively simple problem, but it's starting to annoy me quite a bit. I have two issues with a custom Web Part that I have created, both related to property editing at run...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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...
0
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...

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.