Показать сообщение отдельно
  #1 (permalink)  
Старый 09.09.2009, 15:12
ZYBRIK
 
Сообщений: n/a

В IE не срабатывает событие "change" (mootools)
Есть mootools скрипт отправки данных с формы.
Вместо события "submit" поставил "change", и скрипт перестал в IE, а в Opera все отлично работает. Подскажите, может я что то неправильно понимаю...
При этом "submit" работает даже в IE..

<html>
<head>
	<script type="text/javascript" src="../js/mootools.js"></script>
<script>

window.addEvent('domready', function() {
	// You can skip the following two lines of code. We need them to make sure demos
	// are runnable on MooTools demos web page.
	if (!window.demo_path) window.demo_path = '';
	var demo_path = window.demo_path;
	// --
	$('myForm').addEvent('[B]change[/B]', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		//Empty the log and show the spinning indicator.
		var log = $('log_res').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		this.send();
	});
});
</script>

	 <form id="myForm" action="ajax_admin.php" method="get">
	  <select name="x_name">
	   <option value="kluch">Выбрать</option>
	   <option value="tip">Тип</option>
	   <option value="print">Печать</option>
	 </select>
	</form>
</body>
</html>

Последний раз редактировалось Octane, 09.09.2009 в 18:26. Причина: используйте теги [html] и [js] для оформления кода
Ответить с цитированием