michaellunsford Posted December 30, 2006 Share Posted December 30, 2006 Consider the following code:[code]<input type="checkbox" value="1" onchange="window.open('somepage.php?id=123&val=0','_self');" checked="checked" />[/code]It validates and works in firefox, opera, camino, and safari, but not IE.Now, I suppose a popup blocker could be to blame, but they generally announce themselves and this really isn't a popup. It's difficult to test without having access to IE (my windoze computer died). Would IE like this better?[code]<form method="get" action="somepage.php"><input type="hidden" name="id" value="123"><input type="hidden" name="val" value="0"><input type="checkbox" value="1" onchange="this.form.submit();" checked="checked" /></form>[/code]Other thoughts? Quote Link to comment Share on other sites More sharing options...
fenway Posted December 30, 2006 Share Posted December 30, 2006 It shouldn't care... put an alert(1) in there and see. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted January 4, 2007 Author Share Posted January 4, 2007 I think I finally figured it out. onchange is great for select groups, but onclick works much better for checkboxes (well, in IE anyway). Quote Link to comment Share on other sites More sharing options...
fenway Posted January 5, 2007 Share Posted January 5, 2007 Whoops... didn't even see onchange there... my bad. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.