Hi Community,
I'm trying to enable the on load disabled textbox when the radio button is selected. When the yes (radio button) is being selected the disabled textbox should be enable
How to enable the on load disabled textbox when the radio button is selected
ricsdpl
You can use the below code linking it to your previous query.
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
function notchange(){
if(jQuery('li').find('label').eq(0).hasClass('q-checked')){
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').prop("disabled",true);
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').attr('placeholder', "");
}
else
{
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').prop("disabled",false);
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').attr('placeholder', "test");
}
}
notchange()
});
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').attr('placeholder', "test");
jQuery("[type='checkbox']").change(function()
{
if(jQuery('li').find('label').eq(0).hasClass('q-checked'))
{
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').prop("disabled",true);
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').attr('placeholder', "");
}
else
{
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').prop("disabled",false);
jQuery('.TextEntryBox.InputText.QR-QID24-1-TEXT.QWatchTimer').attr('placeholder', "test");
}
});
});
Change the QID appropriately. Hope it helps!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.