Community > Discussions
118 views
1 replies

Liveforms & Javascript

Hi Everyone,

I'm trying to find the correct syntax to use an if statement as an "on form view" action.

The following code does not work: (always results in 0)  I tried having the semicolon at the end as well.

if ([What size are your windows?] = "L") {
[How many windows would you like to replace?] * 10
} else if ([What size are your windows?] = "M") {
[How many windows would you like to replace?] * 20
} else if ([What size are your windows?] = "S") {
[How many windows would you like to replace?] * 30
}

What am I doing wrong? Any thoughts would be appreciated!

Thanks,

Tom

Tom Glod Tom Glod
Published 02/27/2020 22:13
Add Comment
Ashish Pachori

In Live Forms, You can not use conditions like you described above. You can only evaluate JavaScript; optionally based on another field.

Thanks

 

replied 02/28/2020 06:03

Last Activity 02/28/2020 06:03