Tim Hibbard

Software Architect for EnGraph software


News





Add to Google





My Stats

  • Posts - 593
  • Comments - 397
  • Trackbacks - 507

Twitter












Tag Cloud


Recent Comments


Recent Posts


Article Categories


Archives


Post Categories


Image Galleries


EnGraph Blogs


Links


Other


Roll



The messaging feature of Where's Tim was not working in FireFox and Safari.

I changed my javascript code from:

var msg = document.getElementById(”txtMessage”).getAttribute(”value”);
var frm = document.getElementById(”txtFrom”).getAttribute(”value”);

To:

var msg = document.getElementById(”txtMessage”).value;
var frm = document.getElementById(”txtFrom”).value;

That seemed to be the fix for Firefox.  I admire you web developers, this is much less intuitive than fat client development :)


posted @ Saturday, December 03, 2005 1:16 PM | Filed Under [ Where's Tim ]

Comments

Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Carlton on 11/20/2006 11:28 PM
Thanks a lot for this tip..saved me a lot of headache... :D
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by itHighway.co.uk on 4/5/2007 10:33 AM
Hello,

I had similar problem when working with ajax and used following to resolve the issue:

var msg=document.getElementNodeById(”message”);
var frm=document.getElementNodeById(”from”);

Also make sure to remove any spaces between variable and dom object
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by fwfwe on 5/15/2007 10:20 AM
fwefwefwefwefwef
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Vibhore Benjamin on 5/18/2007 4:43 AM
I m developing an ASP.NET 2.0 Website, in which i have a Panel and i want to give its height through javascript.
the code that i have written is working fine in IE but in FireFox the code is not working. Actually the function document.getElementId is not working

i have an ASP.NET panel by id 'pan1 '

i have written the following code

document.getElementById('<%=pan1.ClientID%>').height = 300;


the above code is working fine in IE but not in FireFox
Can u plz help me out .
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Nahum Silva on 5/21/2007 6:10 PM
you are missing the style attribute..

document.getElementById('<%=pan1.ClientID%>').style.height = 300;
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by nahum silva on 5/21/2007 6:11 PM
also the "300px" or '300px'
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by dfgdfg on 5/29/2007 12:33 AM
dfhfghfgh
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Lee on 5/31/2007 12:08 PM
I am having trouble with the getElementById in firefox. I am trying to grab all the form objects so i can run through and validate it.

Currently, I have:
var formObj = document.getElementById(formname);

It works great in IE, but on FF it craps out. I have tried this several different ways, but i refuses to grab all of the form elements.
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by rootnode on 6/12/2007 3:06 AM
you need to set the id attribute of the form tag to be [formname]

<form name="formname" id="formname"...

IE picks up on 'name' which is where the confusion lies...
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by asdfasdfasdf on 7/5/2007 3:58 PM
asdfasdf
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Business Cards on 7/7/2007 8:44 AM
I find it very handy to dynamically store information in HTML tags that describes it so my program can later pull it back out. This lets the server create the page, embed some details such as database ID numbers or other important information, then let JavaScript on the client access this hidden attribute information when creating dynamic URLs.

For example, the server might dynamically create a table with rows looking like this:

<TR ID=Row1 TICKET="65023"><TD>Support Ticket Information goes here...</TD></TR>

This might display 20 or 30 rows of information, with each row having a unique "TICKET" attribute which can be acquired with the getAttribute() JavaScript command. Then the JavaScript can create a dynamic URL based on the ticket number that the user chose (using other JavaScript).
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by rinku on 7/9/2007 5:29 AM
dfhghdghdghdghdfdfhghdfhgh
Gravatar # Loop in javascript not working in FF
Posted by Hari on 7/19/2007 4:45 AM
The below code is not working in FF but works fine in IE

if(document.getElementById("approve" + icount).checked){
.....
......
}
Any Inputs?

Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Yunus on 8/14/2007 9:21 AM
Hi all
following code is run in IE but not in firefox

var fileUpload = document.getElementById("<%=FileUpload1.ClientID %>");
fileUpload.click();

help please
Gravatar # re: document.getElementById(id).getAttribute(&quot;value&quot;) on FireFox
Posted by test on 9/19/2007 3:16 PM
dsfdsfdsf
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by POPO on 11/27/2007 8:12 AM
this code working on IE but not in Firefox, best regars for help.

<script language="javascript" type="text/javascript">
function strValue()
{ document.getElementById("input_1").value=document.getElementById("select_1").options[document.getElementById("select_1").selectedIndex].text;
}
Gravatar # document.getElementById(radiobuttonlist)
Posted by yuvraj on 1/31/2008 1:04 AM
i want to check using java script the radiobutton in RADIOBUTTONLIST is checked or not.
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by Terry on 2/2/2008 10:40 AM
code works with IE not FF

var a=new Array();a['United States']=new Array('Alabama','Alaska','American Somoa','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','District of Columbia','Florida','Guam','Georgia','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','New Hampshire','Nevada','New Jersey','New Mexico','New York','North Carolina','North Dakota','Ohio','Oklahoma','Oregon','Pennsylvania','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Vermont','Virginia','Washington','West Virginia','Wisconsin','Wyoming');function setStates(){
cntrySel=document.getElementById('country');
stateList=a[cntrySel.value];
changeSelect('born_state',stateList,stateList);
changeSelect('state',stateList,stateList);
changeSelect('shipstate',stateList,stateList);}
function changeSelect(fieldID,newOptions,newValues){
selectField=document.getElementById(fieldID);
selectField.options.length=0;for(i=0;i<newOptions.length;i++)
{selectField.options[selectField.length]=new Option(newOptions[i],newValues[i]);}}


function addLoadEvent(func){var b=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){b();}
func();}}}
addLoadEvent(function(){setStates();});
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by doctorSpoc on 3/5/2008 11:36 AM
this script works in IE but not in Firefox or Safari... not my script but a site that i'm using... want to send to the administrator.

window.history.forward(1);
function chk(cb){
var ck = false;
var ck1 = false;
var ck2 = false;
var ck3 = false;
var ck4 = false;
var ck5 = false;
var ck6 = false;

if (document.getElementById('c1').checked == true) {
ck1 = true;
}
if (document.getElementById('c2').checked == true) {
ck2 = true;
}
if (document.getElementById('c3').checked == true) {
ck3 = true;
}
if (document.getElementById('c4').checked == true) {
ck4 = true;
}
if (document.getElementById('c5').checked == true) {
ck5 = true;
}
if (document.getElementById('c6').checked == true) {
ck6 = true;
}
if(ck1 == true && ck2 == true && ck3 == true && ck4 == true && ck5 == true && ck6 == true){
ck = true }

if (ck == true) {
document.getElementById('mybutton').disabled = false;
}
else {
document.getElementById('mybutton').disabled = true;
}


}
//-->
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by kjljfld on 3/12/2008 1:37 AM
kljdslfjdslkfjklsdfjksldfjldsfldsfdksl
Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by g04tee on 4/30/2008 2:19 PM
This doees not work on firefox:

document.getElementById("state").disabled=true;

Do any of you know how to fix this?
I'm trying to use it in this function, it works on
IE not on firefox

function change()
{
if (document.getElementById("country").value == "USA")
{
document.getElementById("state").disabled=false;
document.getElementById("state").value=""
}
else
{
document.getElementById("state").disabled=true;
document.getElementById("state").value=" ";
}

}

Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by adg on 7/11/2008 2:22 AM
おすすめ猫動画だよ!かわいい猫画像もあるよ。見てね。

Gravatar # re: document.getElementById(id).getAttribute("value") on FireFox
Posted by satish on 7/22/2008 11:54 PM
i want to disable the hyper link
i am using the code
document.getElementById(id).disable=true
its working fine in ie but its not working in firefox
how can i do it
plz hlep me
Post a comment





 

Please add 1 and 3 and type the answer here: