Forum Moderators: open

Message Too Old, No Replies

<input type="file" onblur="alert('ok')" not work with Firebird?

Which works in IE

         

iProgram

9:03 am on Nov 9, 2004 (gmt 0)

10+ Year Member



I want to let people preview the picture before upload it, for example:

<form name="f" enctype="multipart/form-data">
<img name="i" onload="alert('so that I can get the width/height of this pic here');">
<input type="file" name="p" onblur="i.src=p.value">
...
</form>

This works in IE but does not work in FireBird. I need this code to get the width/height values of this picture...

adni18

1:16 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



to get the height of a picture, simply do this [make sure you don't put the width or height attribute in the img tag]:

<img src="beetleshelp.gif" alt="The Beetles' Song: HELP!" name="beetlespic"><script language=javascript type="text/javascript">
<!--
var tempPic=document.images['beetlespic'];
alert(tempPic.width+","+tempPic.height)
//-->
</script>

By the way, the reason Firebird doesn't pick up the onLoad function is probably because it is an onLoad function. Try just putting the script in the BODY onload function, or maybe in just a script at the bottom of the page.