The Function Works But Reports this.refresh() is not a function
- by ren1999
I get this.refresh() is not a function in the error log every time I use this function but it works fine.
Also, when I click on this function for the first time, this.value=undefined. When I click the function again in this form and every other form, the value populates just fine with the previous value.
What could I be doing wrong?
How do I write this function more efficiently?
I still don't quite understand how to use this.value to capture and store a value within an array.
Please notice that I added ---- where there should be a '----<' to be able to display the code.
function askGender(x)
{response="----select class=widgetstyle onClick=_setGender(this.value)----option value=FemaleFemale----option value=MaleMale";
characters[x].setGender(response);
if(this.gender!=0)
{response=this.gender;
this.gender=0;
characters[x].setGender(response);
}
}
function _setGender(x)
{this.gender=x;
this.refresh();
}