Reply function:
$ SQL = "select * from massage where iid = $ iid order by mid desc limit $ offset, $ pagesize"; $ result = $ db-> query ($ SQL ); while ($ row = $ result-> fetch_assoc ())! = False) {echo'
# '. $ Row ["mid"].' '. $ Row ["author"].' |
'. $ Row ["msg"].' Reply '. $ row ["time"].' |
';}
Copy the content read above to textarea:
Script function toCopy () {var midval = document. getElementById ("mid "). innerHTML; var msg = document. getElementById ("msgten "). innerHTML; document. getElementById ("msgcon "). value = "reply" + midval + "" + "[" + msg + "]"; document. getElementById ("msgcon "). focus ();} script
Effect:
The problem is: the text box will always display the last one read by the database, that is, 13th. copy the one to which reply you want to copy it to the box.
Reply to discussion (solution)
Id = "msgten"
Your id is repeated and cannot be used like this.
Modify it to look like this
$ SQL = "select * from massage where iid = $ iid order by mid desc limit $ offset, $ pagesize"; $ result = $ db-> query ($ SQL ); $ I = 0; while ($ row = $ result-> fetch_assoc ())! = False) {echo'
# '. $ Row ["mid"].' '. $ Row ["author"].' |
'. $ Row ["msg"].' Reply '. $ row ["time"].' |
'; $ I ++ ;}
Script function toCopy (c) {var midval = document. getElementById ("mid" + c ). innerHTML; var msg = document. getElementById ("msgten" + c ). innerHTML; document. getElementById ("msgcon "). value = "reply" + midval + "" + "[" + msg + "]"; document. getElementById ("msgcon "). focus ();} script
Id = "msgten"
Your id is repeated and cannot be used like this.
Modify it to look like this
$ SQL = "select * from massage where iid = $ iid order by mid desc limit $ offset, $ pagesize"; $ result = $ db-> query ($ SQL ); $ I = 0; while ($ row = $ result-> fetch_assoc ())! = False) {echo'
# '. $ Row ["mid"].' '. $ Row ["author"].' |
'. $ Row ["msg"].' Reply '. $ row ["time"].' |
'; $ I ++ ;}
Script function toCopy (c) {var midval = document. getElementById ("mid" + c ). innerHTML; var msg = document. getElementById ("msgten" + c ). innerHTML; document. getElementById ("msgcon "). value = "reply" + midval + "" + "[" + msg + "]"; document. getElementById ("msgcon "). focus ();} script
Thank you for solving the problem.
Id = "msgten"
Your id is repeated and cannot be used like this.
Modify it to look like this
$ SQL = "select * from massage where iid = $ iid order by mid desc limit $ offset, $ pagesize"; $ result = $ db-> query ($ SQL ); $ I = 0; while ($ row = $ result-> fetch_assoc ())! = False) {echo'
# '. $ Row ["mid"].' '. $ Row ["author"].' |
'. $ Row ["msg"].' Reply '. $ row ["time"].' |
'; $ I ++ ;}
Script function toCopy (c) {var midval = document. getElementById ("mid" + c ). innerHTML; var msg = document. getElementById ("msgten" + c ). innerHTML; document. getElementById ("msgcon "). value = "reply" + midval + "" + "[" + msg + "]"; document. getElementById ("msgcon "). focus ();} script
Dear God, why can't I copy my new message to the box?
Try another browser
What? After you submit a new message ,?? To box?
Are you new? Incoming? And then? Refresh? Face, then? List again.
If yes ?? The process is ??? . Unless you are not using a post table? And? There is a refresh list.
Are you new? Incoming? And then? Refresh? Face, then? List again.
If yes ?? The process is ??? . Unless you are not using a post table? And? There is a refresh list.
I submitted it using podt. after the submission is successful, the page is refreshed.
Try another browser
Okay. I'll try it back.
After submission, what are the refresh items ????
Cannot I leave a new message? Reply?
Then ?? Did you leave a message? It contains special characters.
Script
Function toCopy (c ){
Var midval = document. getElementById ("mid" + c). innerHTML;
Var msg = document. getElementById ("msgten" + c). innerHTML;
// Add one sentence to see if there is any?
Alert (midval + ''+ msg );
Document. getElementById ("msgcon"). value = "reply" + midval + "" + "[" + msg + "]";
Document. getElementById ("msgcon"). focus ();
}
Script
After submission, what are the refresh items ????
Cannot I leave a new message? Reply?
Then ?? Did you leave a message? It contains special characters.
Script
Function toCopy (c ){
Var midval = document. getElementById ("mid" + c). innerHTML;
Var msg = document. getElementById ("msgten" + c). innerHTML;
// Add one sentence to see if there is any?
Alert (midval + ''+ msg );
Document. getElementById ("msgcon"). value = "reply" + midval + "" + "[" + msg + "]";
Document. getElementById ("msgcon"). focus ();
}
Script
I ran it several times and found that only the one output from the database was invalid. click "reply" to bring up a white box.
After submission, what are the refresh items ????
Cannot I leave a new message? Reply?
Then ?? Did you leave a message? It contains special characters.
Script
Function toCopy (c ){
Var midval = document. getElementById ("mid" + c). innerHTML;
Var msg = document. getElementById ("msgten" + c). innerHTML;
// Add one sentence to see if there is any?
Alert (midval + ''+ msg );
Document. getElementById ("msgcon"). value = "reply" + midval + "" + "[" + msg + "]";
Document. getElementById ("msgcon"). focus ();
}
Script
I ran it several times and found that only the one output from the database was invalid. click "reply" to bring up a white box.
Solved. Open the console and find that the last reply id does not have $ I. I assigned $ I an initial value of 1.