Copy link to clipboard
Copied
I have input a script for a field to fill in 3 others depending on the value entered in one. I keep getting an error saying syntax error ) is missing after condition 1 in line 2.
Here is the script. I have tried placing a second ), but that is not working.I am missing sometthing, but can't figure it out.
if (Player 1 Lvl.value=="1") {
this.getField("Player 1 Multiple 1").value = "1";
this.getField("Player 1 Multiple 2").value = "2");
this.getField("Player 1 Multiple 3").value = "3");
if (Player 1 Lvl.value=="2") {
this.getField("Player 1 Multiple 1").value = "2";
this.getField("Player 1 Multiple 2").value = "3");
this.getField("Player 1 Multiple 3").value = "4");
if (Player 1 Lvl.value=="3") {
this.getField("Player 1 Multiple 1").value = "3";
this.getField("Player 1 Multiple 2").value = "4");
this.getField("Player 1 Multiple 3").value = "5");
}}} else if (Player 1 Lvl.value =="") {
this.getField("Player 1 Multiple 1").value = "";
this.getField("Player 1 Multiple 2").value = "");
this.getField("Player 1 Multiple 3").value = "");
}
Thank you for any help or insight you can give me.
Regards,
Larry Whalen
Copy link to clipboard
Copied
You must use:
this.getField("Player 1 Lvl").value
Copy link to clipboard
Copied
I thought that was the first statement I am using in the script.
if (Player 1 Lvl.value=="1")
then I want it to return the values below in the other fields. Or do I have to put this in for each line.
{
this.getField("Player 1 Multiple 1").value = "1";
this.getField("Player 1 Multiple 2").value = "2");
this.getField("Player 1 Multiple 3").value = "3");
Thanks for the prompt reply.
Copy link to clipboard
Copied
You have a lot of errors in this code. The one Bernd pointed out, plus incorrect use of curly brackets, if-else and parentheses.
Copy link to clipboard
Copied
Thank you everyone. I went into the code and rewrote it. It is now working correctly. I had so many things I missed on this, but have now fixed it.
Thank you for all your help.
Regards,
Larry