Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'getElementById' NOT same in IE & NS?

Status
Not open for further replies.

HollyVally

Programmer
Jan 3, 2003
48
BD
Hi what is the equivalent of 'getElementById' in NS? how to get around the problem of showing the dissimilar display in these 2 ?
 
should wqork fine in both browsers
eg:tested in NN6.2+ and IE5+
<input type=&quot;text&quot; name=&quot;txt&quot; id=&quot;txt&quot; value=&quot;some text&quot;>
<script language=&quot;javascript&quot;>
document.getElementById(&quot;txt&quot;).value = &quot;Something else&quot;;
</script>


____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
I have the following fnc. that runs fine in IE but does not do certain things(indicated with ~ on both sides) in NS:
function setClickedCell(myForm, myCell)
{
var f = document.getElementById(myForm);
var c = document.getElementById(myCell) ;
var v = document.getElementById('chosenCell');

~if ( v.value ) { // if a cell is already selected but do not wish to use anymore
// then unselect it by changing the bgc to normal.
f[v.value].style.backgroundColor = &quot;#FEFACB&quot;;
}~

( c.value )
? c.style.backgroundColor = &quot;#FEFA00&quot; // alert the user that this cell already has a value in.
: c.style.backgroundColor = &quot;#FF0000&quot; ; // select the cell by changing the bgc to red.

~f.chosenCell.value = c.name;~ // finally do the job: select the cell and show it to the user..

return true;
}
 
I just checked my code in NS and it doesn't work either, but works fine in IE. Do we have to enable JavaScript in NS somehow ?
 
I have done that(enabled js in NS) too. I use NS 7.02 and IE 6.0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top