<html>
<body>
At 07:31 AM 1/10/2006, Michael Borchers wrote:<br>
<blockquote type=cite class=cite cite="">
<font face="Verdana" size=2 color="#008000">
input.onblur=function() { call(X) };<br>
</font> <br>
<font face="Verdana" size=2 color="#008000">the only problem: the
function does not receive the value for X.<br>
is that normal?!</font></blockquote><font face="Verdana"><br>
</font>At 08:36 AM 1/10/2006, Michael Borchers wrote:<br>
<blockquote type=cite class=cite cite="">the inputs are created in a php
for().<br>
X for example is 1, 2 ,3<br>
outputting them gives the desired value, f.e. <br>
<font face="Verdana" size=2 color="#008000">function() { call(2 };<br>
</font> <br>
<font face="Verdana" size=2 color="#008000">but when the javasript
function is called it only takes the last number f.e. 3,<br>
but not 2:(</font></blockquote><font face="Verdana"><br><br>
</font>Michael,<br><br>
It's not easy to debug a program we can't see! It's always a good
idea to upload a demonstration page to your server and give us the URL so
we can see your problem complete.<br><br>
Where in your script are you setting X to 1, then 2, then 3? Where
do these assignments take place relative to the onblur
assignments?<br><br>
One possibility is that you're confusing the difference in timing between
PHP and JavaScript. Your PHP script runs to completion, then the
page is downloaded to the browser, then javascript runs. It's
possible that the value that javascript is processing is the last value
PHP output (3).<br><br>
Another possibility is that you're assigning multiple onblur behaviors to
the same object. If I write:<br><br>
<x-tab> </x-tab>Obj.onblur
= function { call(1) };<br>
<x-tab> </x-tab>Obj.onblur
= function { call(2 };<br>
<x-tab> </x-tab>Obj.onblur
= function { call(3 };<br><br>
...then each statement overwrites the onblur assignment of the previous
statement, and all you're left with is call(3).<br><br>
But I'm just stabbing in the dark. May we see your script?<br><br>
Paul</body>
</html>