Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
125
rated 0 times [  129] [ 4]  / answers: 1 / hits: 19179  / 14 Years ago, sat, february 26, 2011, 12:00:00

How do I get Google Chrome (9.0.597.98 on Windows 7 64-bit) to fire a form's onchange? If you play around with the following example, nothing gets consoled out. It's working fine in Firefox 3.6.13.



<form onchange=console.info('form changed')>
<select>
<option>uno</option>
<option>dos</option>
</select>
<input type=radio name=videoDevice value=tres checked=checked />
<input type=radio name=videoDevice value=cuatro checked=checked />
</form>

More From » html

 Answers
11

Binding the change event via JS seems to work ok:



HTML



<form id=test>
<select>
<option>uno</option>
<option>dos</option>
</select>
<input type=radio name=videoDevice value=tres checked=checked />
<input type=radio name=videoDevice value=cuatro checked=checked />
</form>


JS



document.getElementById('test').addEventListener('change', function() {
alert('change fired');
}, false);

[#93568] Thursday, February 24, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jazminuniquer

Total Points: 63
Total Questions: 121
Total Answers: 96

Location: Cambodia
Member since Thu, May 21, 2020
4 Years ago
;