dhtmlx.modalbox example


Can someone provide an example of a Modal box returning input field values. The documentation states…

function returns the html container of the box which can be used for some actions

	var box = dhtmlx.modalbox(...);
	dhtmlx.modalbox.hide(box); //hide popup 

But I don’t know how it can be done.

Please help with an example.



You can use something like next

	var box = dhtmlx.modalbox({ 
		text:"<div id='form_in_box'><div><label> Input width <input class='inform' type='text'></label></div><div><label> Input height <input class='inform' type='text'></label></div><div><label> Input details <textarea class='inform'></textarea></label></div><div><span class='dhtmlx_button'><input type='button' value='save' onclick='save_callback()' style='width:250px;'></span></label></div></div>",
	function save_callback(){
		var inputs = box.getElementsByTagName("input")


I have tried this approach. It no longer works because everything in the window is readonly including the input created with the text: parameter.


Sorry I’m wrong… was using a dhtmlx.confirm and trying to use the text: to get input. Your example shows modalbox.


dhtmlx.confirm blocks all keyboard actions ( to ensure the dialog modality )
If you want to have a custom input - use dhtmlx.modalbox instead.