Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Integrating Custom Javascript

    I have a script that I created for the selection of beads on a custom-designed mother's bracelet. You can see the script here; I just slapped it on the end of the band_signup form contribution for experimental purposes. It does what I need it to do, my only problem is getting the customer's selections to be included in the order information.
    I tried using attributes, and the best I could come up with is shown here. If there were some way to get the same effect as the script using the attributes, that would be great too. Either way, I decided I have no idea how to go about this, just that I need it to work because what I have now just isn't cool. :)
    Any help would be greatly appreciated. Thanks.

  2. #2
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Integrating Custom Javascript

    By the way, here's the script:

    <script language="javascript">
    <!--

    function showimage()
    {
    if (!document.images)
    return
    document.images.pictures1.src=
    document.mygallery1.picture1.options[document.mygallery1.picture1.selectedIndex].value
    }


    function showimage2()
    {
    if (!document.images)
    return
    document.images.pictures2.src=
    document.mygallery2.picture2.options[document.mygallery2.picture2.selectedIndex].value
    }


    function showimage3()
    {
    if (!document.images)
    return
    document.images.pictures3.src=
    document.mygallery3.picture3.options[document.mygallery3.picture3.selectedIndex].value
    }
    //-->
    </script>
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><font size=2><b>Bead 1:</b></font><br><form name="mygallery1"><p>
    <select name="picture1" size="1" onChange="showimage()">
    <option selected value="images/attributes/amethyst2.jpg">Amethyst</option>
    <option value="images/attributes/azurite2.jpg">Azurite</option>
    <option value="images/attributes/onyx2.jpg">Black Onyx</option>
    <option value="images/attributes/bluegoldstone.jpg">Blue Goldstone</option>
    <option value="images/attributes/blueonyx.jpg">Blue Onyx</option>
    <option value="images/attributes/coral2.jpg">Coral</option>
    <option value="images/attributes/crystal2.jpg">Crystal</option>
    <option value="images/attributes/garnet2.jpg">Garnet</option>
    <option value="images/attributes/goldstone2.jpg">Goldstone</option>
    <option value="images/attributes/greenonyx2.jpg">Green Onyx</option>
    <option value="images/attributes/hematite2.jpg">Hematite</option>
    <option value="images/attributes/jade2.jpg">Jade</option>
    <option value="images/attributes/lapis2.jpg">Lapis</option>
    <option value="images/attributes/leopardskin2.jpg">Leopard Skin Jasper</option>
    <option value="images/attributes/malachite.jpg">Malachite</option>
    <option value="images/attributes/redfossil2.jpg">Red Fossil</option>
    <option value="images/attributes/rhodonite2.jpg">Rhodonite</option>
    <option value="images/attributes/rosequartz2.jpg">Rose Quartz</option>
    <option value="images/attributes/snowflake2.jpg">Snowflake Jasper</option>
    <option value="images/attributes/synopal2.jpg">Synthetic Opal</option>
    <option value="images/attributes/pearlbeads2.jpg">Synthetic Pearl</option>
    <option value="images/attributes/tigerseye2.jpg">Tiger Eye</option>
    <option value="images/attributes/turquoise2.jpg">Turqoise</option>
    </select>
    </p>
    </form>
    </td><td><p align="center"><img src="images/attributes/amethyst2.jpg" name="pictures1" width="32" height="32"></td>
    </tr><tr>
    <td><font size=2><b>Bead 2:</b></font><br><form name="mygallery2"><p>
    <select name="picture2" size="1" onChange="showimage2()">
    <option selected value="images/attributes/amethyst2.jpg">Amethyst</option>
    <option value="images/attributes/azurite2.jpg">Azurite</option>
    <option value="images/attributes/onyx2.jpg">Black Onyx</option>
    <option value="images/attributes/bluegoldstone.jpg">Blue Goldstone</option>
    <option value="images/attributes/blueonyx.jpg">Blue Onyx</option>
    <option value="images/attributes/coral2.jpg">Coral</option>
    <option value="images/attributes/crystal2.jpg">Crystal</option>
    <option value="images/attributes/garnet2.jpg">Garnet</option>
    <option value="images/attributes/goldstone2.jpg">Goldstone</option>
    <option value="images/attributes/greenonyx2.jpg">Green Onyx</option>
    <option value="images/attributes/hematite2.jpg">Hematite</option>
    <option value="images/attributes/jade2.jpg">Jade</option>
    <option value="images/attributes/lapis2.jpg">Lapis</option>
    <option value="images/attributes/leopardskin2.jpg">Leopard Skin Jasper</option>
    <option value="images/attributes/malachite.jpg">Malachite</option>
    <option value="images/attributes/redfossil2.jpg">Red Fossil</option>
    <option value="images/attributes/rhodonite2.jpg">Rhodonite</option>
    <option value="images/attributes/rosequartz2.jpg">Rose Quartz</option>
    <option value="images/attributes/snowflake2.jpg">Snowflake Jasper</option>
    <option value="images/attributes/synopal2.jpg">Synthetic Opal</option>
    <option value="images/attributes/pearlbeads2.jpg">Synthetic Pearl</option>
    <option value="images/attributes/tigerseye2.jpg">Tiger Eye</option>
    <option value="images/attributes/turquoise2.jpg">Turqoise</option>

    </select>
    </p>
    </form>
    </td><td><p align="center"><img src="images/attributes/amethyst2.jpg" name="pictures2" width="32" height="32"></td>
    </tr><tr>
    <td><font size=2><b>Bead 3:</b></font><br><form name="mygallery3"><p>
    <select name="picture3" size="1" onChange="showimage3()">
    <option selected value="images/attributes/amethyst2.jpg">Amethyst</option>
    <option value="images/attributes/azurite2.jpg">Azurite</option>
    <option value="images/attributes/onyx2.jpg">Black Onyx</option>
    <option value="images/attributes/bluegoldstone.jpg">Blue Goldstone</option>
    <option value="images/attributes/blueonyx.jpg">Blue Onyx</option>
    <option value="images/attributes/coral2.jpg">Coral</option>
    <option value="images/attributes/crystal2.jpg">Crystal</option>
    <option value="images/attributes/garnet2.jpg">Garnet</option>
    <option value="images/attributes/goldstone2.jpg">Goldstone</option>
    <option value="images/attributes/greenonyx2.jpg">Green Onyx</option>
    <option value="images/attributes/hematite2.jpg">Hematite</option>
    <option value="images/attributes/jade2.jpg">Jade</option>
    <option value="images/attributes/lapis2.jpg">Lapis</option>
    <option value="images/attributes/leopardskin2.jpg">Leopard Skin Jasper</option>
    <option value="images/attributes/malachite.jpg">Malachite</option>
    <option value="images/attributes/redfossil2.jpg">Red Fossil</option>
    <option value="images/attributes/rhodonite2.jpg">Rhodonite</option>
    <option value="images/attributes/rosequartz2.jpg">Rose Quartz</option>
    <option value="images/attributes/snowflake2.jpg">Snowflake Jasper</option>
    <option value="images/attributes/synopal2.jpg">Synthetic Opal</option>
    <option value="images/attributes/pearlbeads2.jpg">Synthetic Pearl</option>
    <option value="images/attributes/tigerseye2.jpg">Tiger Eye</option>
    <option value="images/attributes/turquoise2.jpg">Turqoise</option>
    </select>
    </p>
    </form>
    </td>
    <td><p align="center"><img src="images/attributes/amethyst2.jpg" name="pictures3" width="32" height="32"></td>
    </tr>
    </table>

  3. #3
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Integrating Custom Javascript

    Nevermind....we got it. :)

    If anyone's interested, you can see how here:
    http://www.zen-cart.com/forum/showthread.php?t=103749

    All thanks to Creepur!

 

 

Similar Threads

  1. Custom javascript per page
    By bobmeetin in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Apr 2013, 07:55 PM
  2. Integrating ZenCart with a custom database
    By tangibleLime in forum General Questions
    Replies: 5
    Last Post: 19 Oct 2009, 04:07 AM
  3. Problems integrating php/javascript on main page
    By webrock in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jan 2009, 05:20 AM
  4. Integrating a custom text counter.
    By blobulizer in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 Nov 2006, 03:54 PM

Posting Permissions

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