Action Conditions
November 24, 2021 12:00 AM
Hi there community -
Is there an easy way to include JQuery statements in the Set Action Conditions window?
The image above shows the if statement that I am trying to enact; more specifically the items on teh end that deal with the AICC_Student_ID and the AICC_Student_Name (proctor validation process we are doing).
The image above shows my Set Action Conditions that I am working with. When I publish the content with the above settings it gives me a bunch of quotes in locations I don't want and caused my if/then statement to not function as expected (see below for the actual output from Lectora).
Any thoughts? Tips? Tricks?
Solution
I don't think this field is a suitable place for custom scripts. ".equals()" is a Lectora function that will probably not accept anything but strings or references to Lectora variables as "VAR(myVariable)". Lectora variables always contain strings. Even if you found a way to produce the desired output, I wouldn't expect it to work.
It should be better to do the jQuery part first and put the results into a Lectora variable that can be used in the condition. If it's an entry field that you want to check use the entry fields variable.
Discussion (4)
I don't think this field is a suitable place for custom scripts. ".equals()" is a Lectora function that will probably not accept anything but strings or references to Lectora variables as "VAR(myVariable)". Lectora variables always contain strings. Even if you found a way to produce the desired output, I wouldn't expect it to work.
It should be better to do the jQuery part first and put the results into a Lectora variable that can be used in the condition. If it's an entry field that you want to check use the entry fields variable.
This is what I feared and was about to do, but since I do not have formal training Lectora and it is all learned as we go I figured I'd reach out and see.
Thanks again as always.
If that is a Lectora Entry field you can use its associated variable something like: VAR(Entry_175023)
@wheels that makes total sense - I really didn't put 1 and 1 together...