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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Firefox help on fileupload

Status
Not open for further replies.

Chancellor2000

Technical User
May 18, 2011
3
US
I have the following code which works for IE. But I cannot get anything to work for Firefox.
if (document.selection) {
var inputRange = input.createTextRange();
var theend = inputRange.text.length;
inputRange.moveStart("character", theend);
inputRange.collapse();
inputRange.moveEnd("character", 1);
inputRange.select();
}

For what it is worth, input is a file upload. I just want to show the right side of the text instead of the left side of the text when it doesn't all fit in the associated textbox. The "dir" attribute simply reverses the textbox and the associated browse button.
 
createTextRange is a IE specific method with no Firefox or DOM equivalent.

have a look at this function see if you con modify it.

Written for a BBCode style text editor so it can insert "tags" around selected text.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I have not been able to get selectionStart to work. When I use it, it bombs out when I watch it in firefox.
 
Firefox as well as most other browsers do not allow manipulation of the file input value by Javascript for security reasons.

The best you can hope for is to to just read the value and output it somewhere else as you need.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top