Why is the value of the first value obtained every time? & lt ;? Php & nbsp; while ($ row = mysql_fetch_array ($ query) & nbsp ;{& nbsp ;? & Gt; & nbsp why is the value of the first value obtained every time?
While ($ row = mysql_fetch_array ($ query ))
{
?>
"Size =" 10 "maxLength =" 4 "onblur =" check ( ) "> (Note: a maximum of four words can be entered !)
"Size =" 70 "onblur =" check1 ( ) ">
}
?>
Function check (id)
{
Var tit = document. getElementById ('title'). value;
Alert (tit );
S_xmlhttprequest (); // The above object can be used.
XmlHttp. open ("GET", "changeLink. php? Title = "+ tit +" & id = "+ id, true); // XMLHttpRequest. open (transfer method, address, asynchronous request or not)
XmlHttp. onreadystatechange = byphp; // ready for execution. call the following method:
XmlHttp. send (null); // send
}
Function check1 (id)
{
Var lin = document. getElementById ('link'). value;
S_xmlhttprequest (); // The above object can be used.
XmlHttp. open ("GET", "changeLink. php? Link = "+ lin +" & id = "+ id, true); // XMLHttpRequest. open (transfer method, address, asynchronous request or not)
XmlHttp. onreadystatechange = byphp; // ready for execution. call the following method:
XmlHttp. send (null); // send
}
// Why did I get the id when I first modified it? I have different IDs in each row and should get the values corresponding to different IDs, after a long time, I still don't know what to do. please give me some advice. thank you!
------ Solution --------------------
The title IDs output by loop are the same, so you can only obtain the first title.
"Value =" "Size =" 10 "maxLength =" 4 "onblur =" check ( ) ">
Function check (id)
{
Var tit = document. getElementById ('title' + id). value;
Alert (tit );
...............
The same is true for the link below.
------ Solution --------------------
Reference:
The title IDs output by loop are the same, so you can only obtain the first title.