31 Dec 2018: Thank you to our knowledgeable and friendly forums users for another great year. We are aware of the uptick in spam accounts and are doing our best to ban these at first sight. Thank you for your patience!

warning message code

The CRF i am working on contains several items for which the single-select response to be selected is either YES/NO. On selecting a No response it should trigger a warning message.
Here is my code. For some reason its not working. Can you tell me what's wrong?

 



$.noConflict();
jQuery(document).ready(function($) {
var fieldToCheck = $("#A").parent().parent().find("select");

function setMessage(){
var valueToCheck = fieldToCheck.val();
if (valueToCheck && (valueToCheck ==1)){
$("#A").html("A 'No' answer will exclude the subject. ");
}
else {
$("#A").html("");
};
};
fieldToCheck.change(function(){
setMessage();
});
setMessage();
})

Comments

  • vic-avic-a Posts: 20
    Hi,
    There could be an issue with your selector. most of your code works here https://codepen.io/anon/pen/AXPGRb . Let me know if I misunderstood.

    . If interested to learn more, have an intro and couple more videos at the bottom.

    Let me know if any questions

    Thanks
    vic

    Jini Intro:
    Quick Compare Field Validation:
    Conditional Show/Hide a section:
    Turn any Field into an autofill field:




  • vic-avic-a Posts: 20
    @e74813 Sorry, it seems like audio is not very clear. We will be fixing it soon. Let me know if something is not clear.
Sign In or Register to comment.