instruction in CRF

I created an instruction to pop up when selecting a certain answer. I created the same instruction for 3 fields. The first field worked but the others didn't. I obviously have to define something continuous somewhere.
this is what I wrote:
 

// for OC versions before 3.1.4, use jquery-1.3.2.min.js !

$.noConflict();
jQuery(document).ready(function($) {
var radiosToCheck = $("#ComedMessageDiv").parent().parent().find("input");
function setMessageCoMed(){

for (var i = 1; i < radiosToCheck.length; i++) {
if (radiosToCheck[i].checked) {
var valueToCheck = radiosToCheck[i].value;
}
}

if (valueToCheck && (valueToCheck == 2)){
$("#ComedMessageDiv").html("If 3D Tomosynthesis Mammogram was performed, please fill ImagingWorkUp_3D for 3D portion evaluation. 3D tomosynthesis evaluation will be performed ONLY after 2D evaluation and diagnostic result was given. ");
}
else {
$("#ComedMessageDiv").html("");
};
};
radiosToCheck.change(function(){
setMessageCoMed();
});
setMessageCoMed();
})

where and what do I need to insert to define this to work in the other fields? and, if I want this instruction to appear in color, where and how do I state this?
Michelle

Best Answers

  • Michelle_DMichelle_D Posts: 82
    Accepted Answer
    Perfect! Thanks a lot :-)

Answers

  • haenselhaensel Posts: 530 ✭✭
    edited February 22
    Hi Michelle

    As far as I understand the screenshot the message is shown where it shouldn't. Is this right?
    Your problem might be similar to
    Deselecting radios in multiple grids on the same form
    So please try to alter the ids of the div element for each field to have a unique name and modify your script accordingly.

    Regards,
    Christian
  • Michelle_DMichelle_D Posts: 82
    via Email
    In the screen shot, the instruction for the first "3D Tomosynthesis" (when this radio is selected) appears as it should do.
    Ignore the red subheaders I also created by mistake with the same instruction.
    I want the instruction to appear to the right of the '3D Tomosynthesis' field for the other 2 fields where it askes was a second and third mammography done.

    Michelle Danieli
    Data Manager & Accounts
    A.Stein-Regulatory Affairs Consulting Ltd.

    E-mail: michelle@asteinrac.com
    Tel: +972-9-7670002
    Fax: +972-9-7668534
    Mobile: +972 523 593142 (for whatsapp purposes)

    A. Stein -Regulatory Affairs Consulting Ltd.
    20 HaTa'as St. (P.O.B. 124)
    Beit Hapa'amon Bldg (Suite 102)
    Kfar Saba 4442520
    ISRAEL
  • Michelle_DMichelle_D Posts: 82
    Yep, that's what I was looking for. I didn't know if it was that simple as just adding 1, 2,3 to each one. Thanks a lot! Is there a way of selecting a color? where would I insert the for example, in the script?
  • Michelle_DMichelle_D Posts: 82
    I meant where would I insert the font color="red"
  • GerbenRienkGerbenRienk Posts: 720 ✭✭✭
    Hi Michelle,
    That would be:
    $("#ComedMessageDiv").html("<font color='red'>If 3D Tomosynthesis Mammogram was performed, please fill ImagingWorkUp_3D for 3D portion evaluation. 3D tomosynthesis evaluation will be performed ONLY after 2D evaluation and diagnostic result was given.</font>");
    Mark the single quotes around red, because the double quotes are used to contain the html-content of your div.
    Gerben Rienk
Sign In or Register to comment.