Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

how to select other specify in dropdownlist

hi everyone,
 
i have grid question question name (city)
use a dropdownlist , i  use a other specify option in dropdownlist, but  i select other specify option  do not write a response.
asked Jul 5 by Raza (380 points)

1 Answer

+1 vote
 
Best answer
Since Other specify in drop down list will not show us an text box to write the response even though other option is selected, we need to add a column with open-end box and hide it initially and then display it based on option selected in drop down list.

Below is the piece of JS code for the same.

$(".grid_c2").hide();
if(SSI_GetValue("[% QuestionName() %]_r1_c1") != 61)
{
    $("#[% QuestionName() %]_r1_c2").attr("disabled",true);
}
else
{
    $("#[% QuestionName() %]_r1_c2").attr("disabled",false);
}
$("select").change(function()
{
    tid=$(this).closest('td').next("td").find(".open_end_text_box").attr("id");
    if(SSI_GetValue("[% QuestionName() %]_r1_c1") != 61)
      {
           $("#"+tid).val("");
        $("#"+tid).attr("disabled",true);
        $("#"+tid).removeClass("error_highlight");
        $(".grid_c2").hide();
    }
    else
    {
        $("#"+tid).attr("disabled",false);
        $(".grid_c2").show();
    }
});


Replace 61 with the option number of other specify and you may need to write the validation manually to force the respondent to answer other specify when other is selected in drop down list.
answered Jul 8 by KarthikMahankali Bronze (2,990 points)
selected Aug 2 by Rajesh Rana
sir,
not working  upper JS codes.
not hide .grid_c2
Do you see any error in console. If not, can you check the column number for which you have created open-end box, since it is working at my end.
not error found, column number is correct.
can you send me ssi file, ali.raza@aftabassociates.pk
sure Raza
...