Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts

    combo box image problem i need help !

    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
    Code:
    <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>

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    You missed to close your table and form tags and the width attribute here:
    Code:
    <table border="0"
    cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%"><form name="mygallery"><p>
    Your script itself is erroneous.

    This line:
    Code:
    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:
    Code:
    <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:
    Code:
    document.images.pictures.src=
    document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
    ...into:
    Code:
    document.getElementById('mypicture').src=document.mygallery.picture.value;
    Hope that helps.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • Users who have thanked rangana for this post:

    arian6 (12-12-2008)

  • #3
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rangana View Post
    You missed to close your table and form tags and the width attribute here:
    Code:
    <table border="0"
    cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%"><form name="mygallery"><p>
    Your script itself is erroneous.

    This line:
    Code:
    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:
    Code:
    <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:
    Code:
    document.images.pictures.src=
    document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
    ...into:
    Code:
    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
    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>
    <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>
    Last edited by arian6; 12-11-2008 at 03:17 AM.

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    It seemed you were not able to follow the instructions right.
    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/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>
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #5
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    [QUOTE=rangana;758727]It seemed you were not able to follow the instructions right.
    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/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
    Code:
    </td></tr></form></table>
    ??? i have called ID=mypicture as you told me . And i have change this part
    Code:
    document.getElementById('mypicture').src=document.mygallery.picture.value;
    
    please Rangana tell me what mistake thanks
    Last edited by arian6; 12-11-2008 at 04:36 AM.

  • #6
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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 ???
    Last edited by arian6; 12-11-2008 at 04:50 AM.

  • #7
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    i need help !
    Last edited by arian6; 12-11-2008 at 05:01 AM.

  • #8
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    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/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>
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #9
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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 !

  • #10
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    It's because you need to add highlighted:
    Code:
    <img src="http://boudhatour.wapath.com/test2/mygallery/picture1.gif" id="mypicture" width="200" height="150">
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • Users who have thanked rangana for this post:

    arian6 (12-12-2008)

  • #11
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    its right now does well run thank Sir Rangana for your help http://boudhatour.wapath.com/files/mygallery/index
    salamat bro !

  • #12
    New to the CF scene
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •