# String check

**URL:** <https://forum.kirupa.com/t/string-check/116981>\
**Category:** Uncategorized\
**Created:** [July 23, 2004, 2:34am UTC](https://forum.kirupa.com/t/string-check/116981 "2004-07-23T02:34:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)\
**Post date:** [July 23, 2004, 2:34am UTC](https://forum.kirupa.com/t/string-check/116981/1 "2004-07-23T02:34:28Z")

</div>

This is the code.

```php
 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 ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2004, 4:09am UTC](https://forum.kirupa.com/t/string-check/116981/2 "2004-07-23T04:09:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2004, 5:11am UTC](https://forum.kirupa.com/t/string-check/116981/3 "2004-07-23T05:11:16Z")

</div>

Ha ha ha yeah new thread 🙂

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. 🙂  
Thanx for that by the way.

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

```php
 
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]; } 

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2004, 8:36am UTC](https://forum.kirupa.com/t/string-check/116981/4 "2004-07-23T08:36:48Z")

</div>

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]
