example as requested

bootbox makes dynamic dialogs simple 

var dstring = document.getElementById("hiddendialogues").value;
		dialogues= dstring.split(",");
		
		if (dialogues.length < 2)
		{
		window.location ="week.php?m="+startstring;
		}
		else
		{
		var dstart= "<div class='radio'> <label for='all'><input type='radio' name='dialogues'  id='all' value='all' checked='checked' >all dialogues</label></div>";
		

		for (var i = 0; i < dialogues.length; i++) 
   			{			
			dstart=dstart+"<div class='radio'> <label for='"+dialogues[i]+"'><input type='radio' name='dialogues'  id='"+dialogues[i]+"' value='"+dialogues[i]+"'  >"+dialogues[i]+"</label></div>";
			}
			
		bootbox.dialog({
                title: "choose a dialogue to load in your weekly view",
                message: '<div class="row" style="font-size:12px;>  ' +
                    '<div class="col-md-12"> ' +
                    '<div class="form-group"> ' +
                    '<div class="col-md-4"> ' +	
					dstart +
                    '</div> </div>' +
                    '</form> </div>  </div>',
                buttons: {
                    success: {
                        label: "go to week",
                        className: "btn-success",
                        callback: function () {
                         window.location ="week.php?m="+startstring+"&l="+$("input[name='dialogues']:checked").val();
                        }
                    }
                }
            }
        );