Hi,

Netscape has a nasty way of not seeing onclick (and other) events in an 
image tag or image input element. Wrap anchors around it and place the 
onclick code inside.

<a onclick="...."><input type=image ....></a>

Jay

At 06:39 PM 12/14/2000 +0800, you wrote:
>Greeting,
>Run the code below in IE, it will fire javascript before submit the form.
>However, javascript is not running in Netscape. Unless the type="image"
>change to type="submit".
>
>Anyone mind to tell me why?
>
>Thanks
>- Rudy
>
>
>
>
>
><cfparam name="name1" default="no name">
>
><SCRIPT LANGUAGE="Javascript">
><!--
>function checktime() {
>   var thisday=new Date();
>   var hour=thisday.getHours();
>   if ((hour < 12) && (hour >=6))
>     {alert ("Good Morning!");}
>   if ((hour >= 12) && (hour < 18))
>     {alert ("Good Afternoon!");}
>   if ((hour >=18) && (hour < 22))
>     {alert ("Good Evening! I hope you have had a good day");}
>   if ((hour >=22) || (hour < 4))
>     {alert ("It's late, you really ought to get to bed");}
>   if ((hour >= 4) && (hour < 6))
>     {alert ("It's early, you shouldn't be up yet");}
>
>
>}
>//-->
></SCRIPT>
>
>
><CFFORM action="test1.cfm" name="form1" method="post">
>         <cfinput type="text" name="name1" value="abc"><br>
>         <input type="Image" src="next.gif" onclick="checktime();">
></CFFORM>
>
>
><cfoutput>
><br>
>         #name1#
><br>
></cfoutput>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to