...

View Full Version : combo box image problem i need help !



arian6
12-10-2008, 10:53 AM
hi friends somebody can give me good advice because i dont understand for why it doesn't run please help me thanks a lot: here the url page of the test of that combo script but doesn't run http://boudhatour.wapath.com/test2/mygallery/index


<head>
<title>Hello</title>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<script language="javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.images.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://boudhatour.wapath.com/test2/mygallery/image1.gif">picture test1</option><option value="http://boudhatour.wapath.com/test2/mygallery/image2.gif">picture test2</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image3.gif">picture test3</option>
</select></p></form></td></tr><tr><td width="100%"><p align="center"><img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" name="picture" width="200" height="150"></td></tr></table>
</body>
</html>

rangana
12-10-2008, 11:06 AM
You missed to close your table and form tags and the width attribute here:


<table border="0"
cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"><p>


Your script itself is erroneous.

This line:


document.images.pictures.src = document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value


...is erroneous, and reading on it, I bet it's purpose is to set a new image source on an image element named pictures inside the images form.

Apparently, it doesn't exists in your markup.

Your image's name is picture and your select element's name is picture too.

You might want to change either of those, and point it correctly on your script.

For a fix, try to replace highlighted:


<img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" name="picture" width="200" height="150">


...with id="mypicture".

...and change this part of the script:


document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value


...into:


document.getElementById('mypicture').src=document.mygallery.picture.value;


Hope that helps.

arian6
12-11-2008, 03:27 AM
You missed to close your table and form tags and the width attribute here:


<table border="0"
cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"><p>


Your script itself is erroneous.

This line:


document.images.pictures.src = document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value


...is erroneous, and reading on it, I bet it's purpose is to set a new image source on an image element named pictures inside the images form.

Apparently, it doesn't exists in your markup.

Your image's name is picture and your select element's name is picture too.

You might want to change either of those, and point it correctly on your script.

For a fix, try to replace highlighted:


<img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" name="picture" width="200" height="150">


...with id="mypicture".

...and change this part of the script:


document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value


...into:


document.getElementById('mypicture').src=document.mygallery.picture.value;


Hope that helps.

hello Sir Rangana anyway i have many problem with combo box and slideshow i need learn and for that i use differente forum for learn . Again thank but again i thinks i have mistake something it doesn't run that combobox :
http://boudhatour.wapath.com/test2/mygallery/index
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css"><!-- --></style>
<head>
<title>Hello</title>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<script language="javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.getElementByld('mypicture').src=document.mygallery.picture.value;
}
//-->
</script></head>
<body>
<table border="0"
cellspacing="0" cellpadding="0"
<tr>
<td width="100%><form name="mygallery"></td></tr><p><select name="mypicture" size="1" onChange="showimage()"></td></tr><option selected value="http://boudhatour.wapath.com/test2/mygallery/image1.gif">picture test1</option><option value="http://boudhatour.wapath.com/test2/mygallery/image2.gif">picture test2</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image3.gif">picture test3</option>
</select></p></form></td></tr><tr><td width="100%"><p align="center"><img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" name="mypicture" width="200" height="150"></td></tr></table>
</body>
</html>

rangana
12-11-2008, 03:39 AM
It seemed you were not able to follow the instructions right.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css"><!-- --></style>
<head>
<base href="http://boudhatour.wapath.com/test2/mygallery/index">
<title>Hello</title>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<script type="text/javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.getElementById('mypicture').src=document.mygallery.picture.value;
}
//-->
</script></head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"></td></tr><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="http://boudhatour.wapath.com/test2/mygallery/image1.gif">picture test1</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image2.gif">picture test2</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image3.gif">picture test3</option>

</select>
</td></tr></p></form></td></tr><tr><td width="100%"><p align="center"><img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" id="mypicture" width="200" height="150"></td></tr></table>
<a href="http://c.admob.com/c1.php/2/EkrZ0FPAi3EkAZbbG08-S49407C6106BCA13f302da6125684f7">Find Winter Golf Resorts Las Jolla</a><img src="http://a.admob.com/e0?a=a1488f4d1101950&amp;s=a146fd029ce4483&amp;z=1228962913.08&amp;lt=0.459934113739&amp;rt=2" alt="" width="1" height="1" style="color: #d2ef11"/><br/><a href="http://click.buzzcity.com/click.php?cid=13603&amp;partnerid=12307&amp;rd=http%3A%2F%2Fxtgem.com%2Fc%2Fbuzzcallback%3Fsite%3Dboudhatour .wapath.com">Visit New York City!!!</a><img src="http://txads.buzzcity.com/show.php?txt=1&amp;cid=13603&amp;partnerid=12307" alt="" /></body>
</html>

arian6
12-11-2008, 05:01 AM
[QUOTE=rangana;758727]It seemed you were not able to follow the instructions right.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css"><!-- --></style>
<head>
<base href="http://boudhatour.wapath.com/test2/mygallery/index">
<title>Hello</title>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<script type="text/javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.getElementById('mypicture').src=document.mygallery.picture.value;
}
//-->
</script></head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"></td></tr><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="http://boudhatour.wapath.com/test2/mygallery/image1.gif">picture test1</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image2.gif">picture test2</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image3.gif">picture test3</option>

</select>
</td></tr></p></form></td></tr><tr><td width="100%"><p align="center"><img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" id="mypicture" width="200" height="150"></td></tr></table>
<a href="http://c.admob.com/c1.php/2/EkrZ0FPAi3EkAZbbG08-S49407C6106BCA13f302da6125684f7">Find Winter Golf Resorts Las Jolla</a><img src="http://a.admob.com/e0?a=a1488f4d1101950&amp;s=a146fd029ce4483&amp;z=1228962913.08&amp;lt=0.459934113739&amp;rt=2" alt="" width="1" height="1" style="color: #d2ef11"/><br/><a href="http://click.buzzcity.com/click.php?cid=13603&amp;partnerid=12307&amp;rd=http%3A%2F%2Fxtgem.com%2Fc%2Fbuzzcallback%3Fsite%3Dboudhatour .wapath.com">Visit New York City!!!</a><img src="http://txads.buzzcity.com/show.php?txt=1&amp;cid=13603&amp;partnerid=12307" alt="" /></body>
</html>

[/QUOTE
]

yes so sorry please Sir Rangana be patience with me i am novice in javascript and its hard some time . Can you type in bold or in red colored were the script i have writing is wrong or if i mistake something somewhere because i printing it for good learn always thanks a lot my friend . I will try again now with your script may its right now ?? I tell you later but ok if i am not able to follow your instruction i told you befor i am novice and i need learn step by step exemple you told me i mistake close the tag form table and width i close it
</td></tr></form></table>??? i have called ID=mypicture as you told me . And i have change this part
document.getElementById('mypicture').src=document.mygallery.picture.value;
please Rangana tell me what mistake thanks

arian6
12-11-2008, 05:45 AM
also another point not clear for me do you ask me before to renamed image1.gif by mypicture1.gif and image2.gif by mypicture.gif and image3.gif by mypicture3.gif ???

arian6
12-11-2008, 05:55 AM
i need help !

rangana
12-11-2008, 06:00 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css"><!-- --></style>
<head>
<base href="http://boudhatour.wapath.com/test2/mygallery/index">
<title>Hello</title>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<script type="text/javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.getElementById('mypicture').src=document.mygallery.picture.value;
}
//-->
</script></head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"></td></tr><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="http://boudhatour.wapath.com/test2/mygallery/image1.gif">picture test1</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image2.gif">picture test2</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/image3.gif">picture test3</option>

</select>
</td></tr></p></form></td></tr><tr><td width="100%"><p align="center"><img src="http://boudhatour.wapath.com/test2/mygallery/image1.gif" id="mypicture" width="200" height="150"></td></tr></table>
<a href="http://c.admob.com/c1.php/2/EkrZ0FPAi3EkAZbbG08-S49407C6106BCA13f302da6125684f7">Find Winter Golf Resorts Las Jolla</a><img src="http://a.admob.com/e0?a=a1488f4d1101950&amp;s=a146fd029ce4483&amp;z=1228962913.08&amp;lt=0.459934113739&amp;rt=2" alt="" width="1" height="1" style="color: #d2ef11"/><br/><a href="http://click.buzzcity.com/click.php?cid=13603&amp;partnerid=12307&amp;rd=http%3A%2F%2Fxtgem.com%2Fc%2Fbuzzcallback%3Fsite%3Dboudhatour .wapath.com">Visit New York City!!!</a><img src="http://txads.buzzcity.com/show.php?txt=1&amp;cid=13603&amp;partnerid=12307" alt="" /></body>
</html>

arian6
12-11-2008, 08:30 AM
Ok sir right i have renamed all image1.gif , image2.gif , image3.gif at picture1.gif,picture2.gif , picture3.gif and change the adress link name . I have following the advice you give to me before and close the tag form table you can see in bold down what i have change in this script but always it doesn't run why? [code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css"><!-- --></style>
<head>
<base href="http://boudhatour.wapath.com/test2/mygallery/index">
<title>Hello</title>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<script type="text/javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.getElementById('mypicture').src=document.mygallery.picture.value;
}
//-->
</script></head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"></td></tr><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="http://boudhatour.wapath.com/test2/mygallery/picture1.gif">picture test1</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/picture2.gif">picture test2</option>
<option value="http://boudhatour.wapath.com/test2/mygallery/picture3.gif">picture test3</option>

</select>
</td></tr></p></form></td></tr><tr><td width="100%"><p align="center"><img src="http://boudhatour.wapath.com/test2/mygallery/picture1.gif" id="picture" width="200" height="150"></td></tr></table>
</body>
</html>
it always doesn't run and i dont understand for wich reason please tutorialise me about that combo box pleasssss sir rangana salamat ko bro !

rangana
12-11-2008, 08:41 AM
It's because you need to add highlighted:


<img src="http://boudhatour.wapath.com/test2/mygallery/picture1.gif" id="mypicture" width="200" height="150">

arian6
12-12-2008, 08:38 AM
its right now does well run thank Sir Rangana for your help http://boudhatour.wapath.com/files/mygallery/index
salamat bro !
;)

giwrgos
05-25-2009, 07:28 PM
i want a help pls

index file




<meta name="description" content="E-car Pooling System" />
<meta name="keywords" content="ecar, , car pooling" />
<meta name="author" content=E-Car" />
<script type="text/javascript"> '; ?>


<!--

function showimage() {
if (!document.images)
return
document.getElementById('mypicture').src=document.cartype.picture.value;
}

//-->
<?php echo '</script>
<title> E-car Pooling : </title>
</head>



and the file im calling the java script




if($_SESSION["type_reg"] == "Driver")
{
echo '<b><label>Please select your type of car:</label></b>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="cartype"></td></tr><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="registration/images/picture1.gif">Roadster/Van</option>
<option value="registration/images/picture2.gif">Saloon</option>
<option value="registration/images/picture3.gif">Mini Van</option>
</select>
</td>
</tr>
</p>
</form>
</td>
</tr>
<tr>
<td width="100%"><p align="center"><img src="registration/images/picture1.gif" id="mypicture" width="70%" height="70%"></td>
</tr>
</table>';

where is the problem? pls help me



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum