code work in ie but not in ff

S

shotokan99

i just want to ask why this set of functions doesnt work in ff but
perfectly works in ie:

document.myform.fname.focus();
document.myform.fname.select();
 
R

RobG

i just want to ask why this set of functions doesnt work in ff but
perfectly works in ie:

document.myform.fname.focus();
document.myform.fname.select();

They "work" in Firefox 2.0.0.6, though you might like to use feature
detection before attempting to use them.


<form>
<textarea name="ta">textarea text</textarea>
<input type="text" name="tx" value="input text">
<input type="button" value="select ta"
onclick="this.form.ta.select();">
<input type="button" value="select tx"
onclick="this.form.tx.select();">
</form>
 
S

Steve Swift

i just want to ask why this set of functions doesnt work in ff but
perfectly works in ie:

document.myform.fname.focus();
document.myform.fname.select();

Judging by name (fname) this is applied to an:
<INPUT TYPE=FILE NAME=fname> tag.

The functions just work in IE but just don't in FireFox. They don't work
in Opera or Netscape either. I can't make up my mind if they work or not
in Safari (for Windows) as it's a totally different sort of control (no
input area, just a "Choose File" button.
 
T

Thomas 'PointedEars' Lahn

Steve said:
shotokan said:
i just want to ask why this set of functions doesnt work in ff but
perfectly works in ie:

document.myform.fname.focus();
document.myform.fname.select();

Judging by name (fname) this is applied to an:
<INPUT TYPE=FILE NAME=fname> tag.

The functions just work in IE but just don't in FireFox. They don't work
in Opera or Netscape either. [...]

The focus() method works in (my) Firefox 2.0.0.6 and Opera 9.22 Build 8801.
It just does not do what you expect: it moves the focus to the "Browse"
button next to the input box. Depending on the Netscape version you have
tested with, it should work in Netscape as well (at least Netscape 6+ which
is Gecko-based as is Firefox).

Please provide proper attribution of quoted material, such as above.

http://www.jibbering.com/faq/faq_notes/clj_posts.html


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top