473,800 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.t itle" helptext="Help message" value="" size=80>

The code :

var e = document.mainfo rm.elements;
for(i=0;i<e.len gth;i++)
{
var formObject = e[i];

if(formObject.h elptext != null)
{
formObject.onmo useover=mouseOv erHandler;
formObject.onmo useout=mouseOut Handler;
}
}
The above code works under IE6 but not with Firefox, nothing happen because
formObject.help text is undefined.
What's wrong ? Does Firefox not support custom properties ?
Thanks

Jul 23 '05 #1
2 3884
"Zouplaz" <po***@pouet.co m> wrote in message
news:Xn******** ************@21 2.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.t itle" helptext="Help message" value="" size=80>

The code :

var e = document.mainfo rm.elements;
for(i=0;i<e.len gth;i++)
{
var formObject = e[i];

if(formObject.h elptext != null)
{
formObject.onmo useover=mouseOv erHandler;
formObject.onmo useout=mouseOut Handler;
}
}
The above code works under IE6 but not with Firefox, nothing happen
because
formObject.help text 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.t itle" 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.getAttribu te && ctl.getAttribut e('helptext'))
{
ctl.onmouseover =function() { alert('Over: ' +
ctl.getAttribut e('helptext')); };
ctl.onmouseout= function() { alert('Out: ' +
ctl.getAttribut e('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*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Grant Wagner - gw*****@agricor eunited.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.t itle" 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.getAttribu te && ctl.getAttribut e('helptext'))
{
ctl.onmouseover =function() { alert('Over: ' +
ctl.getAttribut e('helptext')); };
ctl.onmouseout= function() { alert('Out: ' +
ctl.getAttribut e('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
9303
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 action="MaintNotification.php?ReqID=5" method="post" name="frm5"> <tr align="left" bgcolor="#dddddd" class="text" onClick="submit()"
13
6358
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 well as Page Valet indicate it is valid. The page is being served with the proper MIME type of "application/xhtml+xml". Unfortunately, Firefox will not display the page due to a non-breaking
0
1551
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
2302
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 to: javascript:gridWidget.editColumn(3, 3, 'PDDSectionForm', 'pdd_link', ..) The above works fine in IE.
10
12911
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 you look at it in IE (6 or 7), you find it also looks fine, except for the top margin missing from the links across the top of the page. That's not the main issue here, but any pointers as to why it doesn't show them would be appreciated.
9
3806
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 techniques are not feasible) The question is; Given that I have a Person object with a private set for id. What is the recommended approac in passing that object to the web service
5
10774
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() { if(xmlhttp.readyState==4) {
6
5835
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 to the function upon clicking. The property value is one of the attributes defined for each respective href in the property list. In IE and Netscape, the property values pass correctly, but in Firefox, only the last property value in the list...
3
6686
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 time using an EditorZone. One of my web parts contains a control which displays information for a particular (default) user. The user should have the ability to select an alternate user whose information should be displayed in the control, and...
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10279
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...
0
10036
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
9092
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
5473
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...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
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
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
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.