Answered
Searching all fields [Javascript]
Im trying to make a form where if I hit a button all fields containing the word: "General" will be. changed to ""(nothing).
Is this possible?
Im trying to make a form where if I hit a button all fields containing the word: "General" will be. changed to ""(nothing).
Is this possible?
Assuming these are text fields, you can do it using this code:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (f.type=="text" && /General/.test(f.valueAsString)==true) {
f.value = "";
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.