String check

This is the code.

 for(i=0;i<=10;i++){ 
eval("ring"+i).writename.text = this["writename"+i];
 
if (eval("ring"+i).writename.text == "undefined") {
eval("ring"+i).writename.text = "No entry";}
}

“undefined” is what is diplayed in the text box, it comes from mySQL > PHP, any ideas on how to change that ?

new thread huh?

this is obviously your problem:

[AS]
this[“writename”+i]
[/AS]

trace this variable throughout your code and make sure it is defined. check to see if you are using the correct dynamic variable names in your loadVars or whatever.

Ha ha ha yeah new thread :slight_smile:

A minute after I posted the last one, I found this[“var”+i] in F1.
So I thought I would delete the thread since I no longer needed help.

5 minutes later I got a e-mail with your reply, but it was too late and the thread was gone. :slight_smile:
Thanx for that by the way.

[size=4][color=blue]Solved[/color][/size]

 
for(i=0;i<=10;i++){
// *******************************************
if (this["writename"+i] == undefined) {
 eval("ring"+i).writename.text = "";
}else{
 eval("ring"+i).writename.text = this["writename"+i]; } 

Something isn’t right but I dont know what.

[color=blue]**eval(“ring”+i).writename.text = this[“writename”+i]; **[/color]

This works and it is displayed in the text box.

But if I try to change it, it doesn’t work ie

[color=blue]eval(“ring”+i).writename.text = “dog”;
[/color]