Getting onClick to work in Internet Explorer
Posted: Thu Nov 26, 2009 9:48 am
I have a <select> on my webpage which when you click on one of the options it should change an input box's value depending on which option was clicked. This is all very good in firefox but when it comes to useless IE like usual, nothing works.
And i have some img tags which have an onclick property too which when the image is clicked, the input value it sits next to should empty, again, works fine in FF but now IE.
Any ideas on how to get this working in IE?
Thanks a lot!
Code: Select all
<select name="pics" class="cmsinput">
<option class="cmsinput" OnClick="editnews.pic1.value = 'newsimg/<?php echo $row->name; ?>'" value="pic1">Main Image</option>
<option OnClick="editnews.pic2.value = 'newsimg/<?php echo $row->name; ?>'" value="pic2">2nd Image</option>
<option class="cmsinput" OnClick="editnews.pic3.value = 'newsimg/<?php echo $row->name; ?>'" value="pic3">3rd Image</option>
<option OnClick="editnews.pic4.value = 'newsimg/<?php echo $row->name; ?>'" value="pic4">4th Image</option>
<option class="cmsinput" OnClick="editnews.pic5.value = 'newsimg/<?php echo $row->name; ?>'" value="pic5">5th Image</option>
<option OnClick="editnews.pic6.value = 'newsimg/<?php echo $row->name; ?>'" value="pic6">6th Image</option>
<option class="cmsinput" OnClick="editnews.pic7.value = 'newsimg/<?php echo $row->name; ?>'" value="pic7">7th Image</option>
<option OnClick="editnews.pic8.value = 'newsimg/<?php echo $row->name; ?>'" value="pic8">8th Image</option>
<option class="cmsinput" OnClick="editnews.pic9.value = 'newsimg/<?php echo $row->name; ?>'" value="pic9">9th Image</option>
<option OnClick="editnews.pic10.value = 'newsimg/<?php echo $row->name; ?>'" value="pic10">10th Image</option>
<option class="cmsinput" OnClick="editnews.pic11.value = 'newsimg/<?php echo $row->name; ?>'" value="pic11">11th Image</option>
<option OnClick="editnews.pic12.value = 'newsimg/<?php echo $row->name; ?>'" value="pic12">12th Image</option>
<option class="cmsinput" OnClick="editnews.pic13.value = 'newsimg/<?php echo $row->name; ?>'" value="pic13">13th Image</option>
<option OnClick="editnews.pic14.value = 'newsimg/<?php echo $row->name; ?>'" value="pic14">14th Image</option>
<option class="cmsinput" OnClick="editnews.pic15.value = 'newsimg/<?php echo $row->name; ?>'" value="pic15">15th Image</option>
<option OnClick="editnews.pic16.value = 'newsimg/<?php echo $row->name; ?>'" value="pic16">16th Image</option>
</select>
Code: Select all
<tr>
<td><img onclick="editnews.pic1.value=''" src="cross.png" width="20" height="20" /> Main Img <input class="cmsinput" type="text" name="pic1" value="<?php echo $expimg[1]; ?>" /></td>
<td><img onclick="editnews.pic9.value=''" src="cross.png" width="20" height="20" /> 9th Img <input class="cmsinput" type="text" name="pic9" value="<?php echo $expimg[9]; ?>"
/></td>
</tr>
<tr>
<td><img onclick="editnews.pic2.value=''" src="cross.png" width="20" height="20" /> 2nd Img <input class="cmsinput" type="text" name="pic2" value="<?php echo $expimg[2]; ?>"
/></td>
<td><img onclick="editnews.pic10.value=''" src="cross.png" width="20" height="20" /> 10th Img <input class="cmsinput" type="text" name="pic10" value="<?php echo $expimg[10]; ?>" /></td>
</tr>
<tr>
<td><img onclick="editnews.pic3.value=''" src="cross.png" width="20" height="20" /> 3rd Img <input class="cmsinput" type="text" name="pic3" value="<?php echo $expimg[3];
?>" /></td>
<td><img onclick="editnews.pic11.value=''" src="cross.png" width="20" height="20" /> 11th Img <input class="cmsinput" type="text" name="pic11" value="<?php echo $expimg[11]; ?>" /></td>
</tr>
<tr>
<td><img onclick="editnews.pic4.value=''" src="cross.png" width="20" height="20" /> 4th Img <input class="cmsinput" type="text" name="pic4" value="<?php echo $expimg[4];
?>" /></td>
<td><img onclick="editnews.pic12.value=''" src="cross.png" width="20" height="20" /> 12th Img <input class="cmsinput" type="text" name="pic12" value="<?php echo $expimg[12]; ?>" /></td>
</tr>
<tr>
<td><img onclick="editnews.pic5.value=''" src="cross.png" width="20" height="20" /> 5th Img <input class="cmsinput" type="text" name="pic5" value="<?php echo $expimg[5];
?>" /></td>
<td><img onclick="editnews.pic13.value=''" src="cross.png" width="20" height="20" /> 13th Img <input class="cmsinput" type="text" name="pic13" value="<?php echo $expimg[13]; ?>" /></td>
</tr>
<tr>
<td><img onclick="editnews.pic6.value=''" src="cross.png" width="20" height="20" /> 6th Img <input class="cmsinput" type="text" name="pic6" value="<?php echo $expimg[6];
?>" /></td>
<td><img onclick="editnews.pic14.value=''" src="cross.png" width="20" height="20" /> 14th Img <input class="cmsinput" type="text" name="pic14" value="<?php echo $expimg[14]; ?>" /></td>
</tr>
<tr>
<td><img onclick="editnews.pic7.value=''" src="cross.png" width="20" height="20" /> 7th Img <input class="cmsinput" type="text" name="pic7" value="<?php echo $expimg[7];
?>" /></td>
<td><img onclick="editnews.pic15.value=''" src="cross.png" width="20" height="20" /> 15th Img <input class="cmsinput" type="text" name="pic15" value="<?php echo $expimg[15]; ?>" /></td>
</tr>
<tr>
<td><img onclick="editnews.pic8.value=''" src="cross.png" width="20" height="20" /> 8th Img <input class="cmsinput" type="text" name="pic8" value="<?php echo $expimg[8];
?>" /></td>
<td><img onclick="editnews.pic16.value=''" src="cross.png" width="20" height="20" /> 16th Img <input class="cmsinput" type="text" name="pic16" value="<?php echo $expimg[16]; ?>" /></td>
</tr>
Thanks a lot!