Hi,
I have configured a live field script to work on edit screen. It works fine for events like click , mouseover and all. The script should work once the edit screen loads.
I tried adding load event and it did not work. My script is to check for a field to be required based on other field. this works when i click or change value but when the form loads it is not working until an event occurs and am able to proceed with the submit button.
I know this can be done through behaviour script. I just want to know if this is possible in SIL Live fields.
Please let me know if this is possible.
Thanks,
Krithica
Hello,
LIve fields do work on screen load. When you create a Live field you provide a sil script. You can put your code there and the code will work on loading a screen. If you want a script to work on a certain event then you define the lfWatch routine in the script.
Without if watch routine the script is not working.
Below is my script
if( argv["screen"] == "edit") {
if((argv["customfield_A"] == "Value") &&((argv["customfield_B"] != "Yes" && argv["customfield_B"] != "No"))){
{
lfShowFieldMessage("customfield_B", "Field is required", "ERROR");
lfDisable("editSubmit");
}
}
else{
lfHideFieldMessage("customfield_B");
lfEnable("editSubmit");
}
}
In the Live fields configuration i gave this directly and it did not work. It works only if i add a mainscript with ifwatch routine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your script will not work because you use argv["customfield_B"]
You should query values as if it is a post function: customfield_b
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.