Unstoppable Domains

Form not working in FireFox

Spaceship Spaceship
Watch

noswad

Established Member
Impact
1
Hi. This form is working in IE but not in FF. Note how the images don't load in FF :'(

The code I have used is this:

Javascript in the head

<script language="javascript">
<!--
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].test
}
//-->
</script>

Form:

PHP:
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"><p><select
name="picture" size="1" onChange="showimage()">
<option selected test="mobiles/images/handsets/6230i.jpg" value="Nokia 6230i">Nokia 6230i</option>
<option test="mobiles/images/handsets/6030.jpg" value="Nokia 6030 Val">Nokia 6030</option>
<option test="mobiles/images/handsets/6101.jpg" value="Nokia 6101">Nokia 6101</option>
</select></p>
</form>
</td>
</tr>
<tr>
<td width="100%"><p align="center"><img src="mobiles/images/handsets/6230i.jpg" name="pictures" width="99"
height="100"></td>
</tr>
</table>

Thanks for reading :hehe:
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hey,
It doesn't work in Opera either. I revised it, now it works in both IE and Opera. I don't have Firefox but I suppose it works in that too. Cheers!

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript"><!--
function showimage()
{
	document.pictures.src = document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value;
}
//--></script>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<form name="mygallery">
<p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="http://www.freegadgets.co.uk/mobiles/images/handsets/6230i.jpg" value="Nokia 6230i">Nokia 6230i</option>
<option value="http://www.freegadgets.co.uk/mobiles/images/handsets/6030.jpg" value="Nokia 6030 Val">Nokia 6030</option>
<option value="http://www.freegadgets.co.uk/mobiles/images/handsets/6101.jpg" value="Nokia 6101">Nokia 6101</option>
</select>
</p>
</form>
</td>
</tr>
<tr>
<td width="100%">
<p align="center">
<img src="http://www.freegadgets.co.uk/mobiles/images/handsets/6230i.jpg" name="pictures" width="99" height="100">
</td>
</tr>
</table>
</body>
</html>
 
0
•••
Hi

The code works but unfortunately I need the value to not be the image location (this is what is happening when I do a test registration.)

This is where the problem starts - if the value isn't the image location, for some reason the image decides not to show in Firefox etc!

Thanks for trying though :hi:
 
0
•••
That is very strange. Put then a number to the values and create an array in the script with the locations. Then you can use the selected value as the index for the array.
 
0
•••
Hi

I don't have a clue how to do that :'(

Any hints? :hehe:

Cheers for your efforts :)
 
0
•••
Here you go. If this doesn't work either... dump Firefox :td:

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Untitled Document</title> 
<script type="text/javascript"><!-- 
var pics = new Array();

pics[0] = "http://www.freegadgets.co.uk/mobiles/images/handsets/6230i.jpg";
pics[1] = "http://www.freegadgets.co.uk/mobiles/images/handsets/6030.jpg";
pics[2] = "http://www.freegadgets.co.uk/mobiles/images/handsets/6101.jpg";

function showimage() 
{ 
    document.pictures.src = pics[document.mygallery.picture.selectedIndex]; 
} 
//--></script> 
</head> 
<body> 
<table border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td width="100%"> 
<form name="mygallery"> 
<p> 
<select name="picture" size="1" onChange="showimage()"> 
<option value="0" selected>Nokia 6230i</option> 
<option value="1">Nokia 6030</option> 
<option value="2">Nokia 6101</option> 
</select> 
</p> 
</form> 
</td> 
</tr> 
<tr> 
<td width="100%"> 
<p align="center"> 
<img src="http://www.freegadgets.co.uk/mobiles/images/handsets/6230i.jpg" name="pictures" width="99" height="100"> 
</td> 
</tr> 
</table> 
</body> 
</html>
 
0
•••
Thankyou very much! I really appreciate that :xf.love: :hehe:

David :) :)
 
0
•••
You're welcome, cheers!
 
0
•••
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back