faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

47 of 98 people (48%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

What all JScript events works in IE4 but not in IE5 ? eg. <INPUT TYPE="FILE"...onChange="test()"> ..The OnChange event works in IE4 but not in IE5

Nov 22nd, 2008 17:38
haytham ali, ha mo, Josh Twist, Felix Gonzalez, Darton Williams, BALAJI HARI,


I had the same problem using a INPUT FILE with IE5. The Onchange event 
doesn´t do anything. It worked perfectly with IE6. So I founded that 
the event Onfocus did the same. In both IE´s.
I used <input type="file" name="FileData" 
OnFocus="javascript:fnChangeFile();">   and 
function fnChangeFile(){
	//Checks for a valid Excel file 	
	var gfile
	gfile=fsParameters.FileData.value
	if  (gfile=="")
		return 0;
	else if (gfile.indexOf(".xls")==-1) 
	{
		//Reload this page
...
You can also use IE's onpropertychange event like so...
<input type="file" onpropertychange="if(event.propertyName=='value')
{alert('run code here');}">
http://6rb.com
http://fr7.com
http://dir.msryat.org
http://6ef.com
http://forums.msryat.org
http://www.arabcar.com
http://www.alshalah.com
http://msryat.org