Показать сообщение отдельно
  #4 (permalink)  
Старый 09.07.2013, 09:09
Профессор
Отправить личное сообщение для skrudjmakdak Посмотреть профиль Найти все сообщения от skrudjmakdak
 
Регистрация: 27.04.2012
Сообщений: 1,410

var form = document.getElementById('prompt-form');
var container = document.getElementById('prompt-form-container');

function showPrompt(text) {  
  document.getElementById('prompt-message').innerHTML = text;  
  container.style.display = 'block';
}

document.getElementById('show-button').onclick = function() {
  showPrompt("Ввод данных:");  
};


form.onsubmit = function() {
	var table = document.getElementById('input_table');

	var tcell= new Array();
	tcell[0]=table.rows[1].cells[0].firstChild.value;
	tcell[1]=table.rows[1].cells[1].firstChild.value;
	tcell[2]=table.rows[1].cells[2].firstChild.value;


	var insert_row=document.createElement('tr');

	for (var j = 0;j<3;j++){
		var td = document.createElement('td');
		td.innerHTML =tcell[j];
		insert_row.appendChild(td);
	}

	var table1=document.getElementById('table1');

	table1.appendChild(insert_row);    

	container.style.display = 'none';
	table.rows[1].cells[0].firstChild.value = '';
	table.rows[1].cells[1].firstChild.value = '';
	table.rows[1].cells[2].firstChild.value = '';
	return false;
    }; 

document.getElementById('cancel').onclick = function() {
  container.style.display = 'none';
};
Ответить с цитированием