By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,521 Members | 1,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,521 IT Pros & Developers. It's quick & easy.

IE - Onchange or Onclick - neither works in this select, what gives?

P: 38
Hi Bytes,

Hope this finds you well this morning.

Expand|Select|Wrap|Line Numbers
  1. echo '<select onChange="window.location=\'viewons.php?onsid=\'+this.value">';
  2. while ($row = mysqli_fetch_array($data)) {
  3. echo "<option>" . $row['onsid'] . "</option>\n";
  4.     }
  5.   echo '</select>';
  6.  
  7.  
That works fine in FF.

I tried moving the onchange down to the select option and using onClick instead but IE still wouldn't work but FF did.

What the heck have I missed in order to make IE interpret this correctly?

Kind Regards and TGIF!
-Aaron

Link to working page if it helps any.
Aug 14 '09 #1
Share this Question
Share on Google+
6 Replies


gits
Expert Mod 5K+
P: 5,390
could you try?:

Expand|Select|Wrap|Line Numbers
  1. echo '<select onchange="window.location.href=\'viewons.php?onsid=\'+this.value">';
kind regards
Aug 15 '09 #2

P: 38
Thanks gits for your response, I do appreciate it.
I ended up getting it working in IE by using a java function to put the URL together for me.

Respectfully,
Aaron
Aug 15 '09 #3

gits
Expert Mod 5K+
P: 5,390
glad to hear you got it working ... even though i wonder why you need a Java-function for that ... so you mix Java, PHP, JavaScript for such a simple task? ...

kind regards
Aug 17 '09 #4

P: 38
Haha yeah I'm thinking the same thing. All that work...
I'm going to now and try to just add .href.
Aug 17 '09 #5

P: 38
@gits
This worked quite well.

I've removed all the extra JS overhead because you are right, all it really needed was a simple .href

Thanks again Gits.
youdaman!

-aaron
Aug 17 '09 #6

gits
Expert Mod 5K+
P: 5,390
sounds & looks much simpler i think ;) ... in case you have more problems just post back to the forum ...

kind regards
Aug 17 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.