We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

CRF: value filled in based on the value of another field

See image: one field should have a value based on the value in another field.
I tried to do this with a script in the sections worksheet (cfr https://www.openclinica.com/forums#/discussion/comment/16250) but it's not working. I have no idea why not.
see Excel template attached.image


  • GerbenRienkGerbenRienk Posts: 838 ✭✭✭
    In your script you use a variable with name "class" which is a reserved word. Ichanged that to TIQClass. Furthermore you can call the Classification function on the keyup event of TotIQ, because that is the only item you have to watch.

    <script src="includes/jmesa/jquery.min.js"></script> 
    <script lang="Javascript">
    var totField = $("#TotIQ").parent().parent().find("input");
    var TIQClassField = $("#TotClass").parent().parent().find("input");
    TIQClassField.attr("readonly", true);
    function TIQClassification(){
    var tot = totField.val();
    var TIQClass = "";
    var curClass = TIQClassField.val();
    TIQClass ="zwakbegaafd";
    if(tot>=85 && tot<100){
    TIQClass ="benedengemiddeld begaafd";
    if(tot>=100 && tot<115){
    TIQClass ="gemiddeld begaafd";
    if(tot>=115 && tot<135){
    TIQClass ="bovengemiddeld begaafd";
    TIQClass ="hoogbegaafd";
  • wwiers0wwiers0 Posts: 18
    This is really great! Thank you very much!!!
This discussion has been closed.