We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Warning message

Hi,

I'm trying to display a warning for a dropdown list (single-select) like it's done here: http://www.trialdatasolutions.com/tds/howto/warning.jsp but it doesn't work.

Can you have a look and tell me what is wrong ?


 



$.noConflict();
jQuery(document).ready(function($) {
var dropdown = $("#warn").parent().parent().find("input");
function setWarn(){
var valueToCheck = dropdown.value;
if (valueToCheck && (valueToCheck == 1)){
$("#warn").html("Warning message!");
}
else {
$("#warn").html("Ok");
};
};
dropdown.change(function(){
setWarn();
});
setWarn();
})




Thank you,

Romain.

Comments

  • GerbenRienkGerbenRienk Posts: 838 ✭✭✭
    Hi Romain,
    Could you try changing
    var dropdown = $("#warn").parent().parent().find("input");
    into
    var dropdown = $("#warn").parent().parent().find("select");
    ?
    Kind regards,
    Gerben Rienk
  • RCHENURCHENU Posts: 207 ✭✭
    Hi Gerben,

    No, it's not working. Do you have another idea ?

    Thank you,

    Romain.
  • RCHENURCHENU Posts: 207 ✭✭
    The "else" message is printing well so I guess that "dropdown" is not well initialized or maybe "dropdown.value" is not the correct syntax...
  • GerbenRienkGerbenRienk Posts: 838 ✭✭✭
    Hi Romain,
    Could you try the attached CRF? Many thanks,
    Gerben Rienk
  • RCHENURCHENU Posts: 207 ✭✭
    Thanks a lot for your time Gerben.
    It works perfectly !

    Romain.
Sign In or Register to comment.