can't get a javascript with return to work on php

A

Anonymous

Guest
i am tying to use a javascript inside a php code i can't get it to work.
Code:
echo "<td nowrap align=right><input value='".$table_row[$row['Column_name']]."' type=text size=20 name='".strtr('index'.$row['Column_name'], " ", "_")."' onfocus='javascript:selectAll( document.forms[0].".strtr('index'.$row['Column_name'], ' ', '_').");'";
if($row['Column_name'] == 'Date')
{                  
    echo " MAXLENGTH=10 size=10 onKeyDown='javascript:return dFilter(event.keyCode, this, '##-##-####','0');'";                                                                                  
/*
?>
MAXLENGTH=10 size=10 onKeyDown="javascript:return dFilter (event.keyCode, this, '##-##-####','0');" >;                                           
<?
*/
}
this is the part that is not working
Code:
echo " MAXLENGTH=10 size=10 onKeyDown='javascript:return dFilter(event.keyCode, this, '##-##-####','0');'";
could it be because it has a return? cause the other javascript is working. :?: [/code]
 
could it be because it has a return?

You should not have a return there.

Also, if you are expecting some kind of return from the function you are calling (dFilter), don't. You might want to reconsider your program structure if you need to use the value being returned.

:) Hope that helps if any
 
Back
Top