"atomo" <atomo@none.cl> writes:
[color=blue]
> Hi, i got a problem with variable handling with mozilla(0.7). These lines
> of code works fine on IE(6), but they doesn't on Mozilla:[/color]
Check this page:
<URL:http://www.mozilla.org/docs/web-developer/upgrade_2.html>
(Previously known as: "Upgrading Your Web Content for Mozilla and
Netscape 6").
It lists the most common features of other browsers that isn't
standard and doesn't work in Mozilla.
[color=blue]
> echo"
> function check(){
> if( ".$name.".value!=\"\" )
> { code }";[/color]
My guess is that what is contained in $name is just the name of
the element, not a proper reference to it.
A proper reference would be
"document.forms['formId'].elements['elemName']"
[color=blue]
> As you can see i set a variable name with PHP, and its value is checked in
> javascript.[/color]
It is pretty hard, going on impossible, to guess what the content of your
$name variable is, and that is what is important for this question. Also,
not everybody understands PHP, so you should show us the *actual* HTML/
Javascript that is sent to the browser. Then we'll find the problem in no
time.
[color=blue]
> Mozilla, shows an error on third line telling that the var is not defined,[/color]
Which var?
[color=blue]
> stopping the execution. With IE and Opera there are no problems.[/color]
[color=blue]
> I'm wondering if this is because IE supports defining a variable in the
> condition, while mozilla doesn't.[/color]
I doubt there is any difference in that.
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'