jeudi 17 décembre 2015

Changing the color of a check-box text while in a dialog box

I have some check boxes, and I want to, when check the box, change the color of the title of the check.. I looked to I want some text to change color when the user checks a checkbox, and modified a little the function there to this:

function hasTickedBox( checkBoxID, textID) {
var chkbx = document.getElementById( checkBoxID );
if ( chkbx.checked ) {
    document.getElementById(textID).style.color = "red";
    document.getElementById(textID).style.fontWeight = bold;
}

I want to apply this function in this dialog:

function dialogOpcoesContTransIso(varArray,overwrite, Nome){
bootbox.dialog('Digite o nome da lâmina a ser salva:<br>\
        <form><input class = "input-block-level" id = "dialogNomeLamina" type = "text"/></form><br>\
        <p id="box1">Abordagem utilizada no cálculo de <i>&Epsilon;</i>&nbsp;&nbsp;<sub>22</sub>:</p><br>\
         <form>\
            <input type="radio" name="e22" value="chamis">Segundo Chamis<br>\
            <input type="radio" name="e22" value="whitney">Segundo Whitney e Riley<br>\
         </form><br>\
        <p id="box2">Abordagem utilizada no cálculo de <i>&alpha;</i>&nbsp;&nbsp;<sub>2</sub>:</p><br>\
         <form>\
            <input type="radio" name="alpha2" value="hashin">Segundo Hashin<br>\
            <input type="radio" name="alpha2" value="weeton">Segundo Weeton, Peters e Thomas<br>\
        </form><br>\
        ',
[   {   "label": "OK",
        "class": "btn-primary primary",
        "callback" : function(){
                            if( !$("input:radio[name=e22]:checked").val() || !$("input:radio[name=alpha2]:checked").val()  )
                                bootbox.alert("Você não selecionou uma das propriedades");
                            else
                                guardarLamina(varArray,overwrite, Nome);
                                }
    },
    {   "label": "Cancelar",
        "class": "btn-primary",
    }
],
{   "header": "",
    "onEspace": true,
}               );
}

so I want to call the function hasTickedBox("e22", "box1") and hasTickedBox("alpha2", "box2") from inside the dialog box.. how to?




Aucun commentaire:

Enregistrer un commentaire