SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbnail Preview In Form

    Ok this is gonna be tough but here goes nothing. I have an order form and in the order form I have 4 different radio button fields (each field selects a pic gallery - one with each gallery name). each radio button shows a different layer ei: if you select corporate gallery a new layer appears in the table cell below with a drop down box with all the names of the pics in that gallery. What I want is when you select the pic name i want a thumbnail to apaer net to the drop down box. Very much like when you update an avatar in some message boards or phpnuke and stuff. I want the thumbnail to change according to the image name in the text box. I am not sure how to do this because each gallery radio button would launch a new layer, is there an easy way.

    Thank you to anyone who can try to help I freatly appreciate it

  2. #2
    SitePoint Evangelist
    Join Date
    Nov 2002
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the function below to re-write the existing layer content:

    function WriteLayer(ID,parentID,sText) {
    if (document.layers) {
    var oLayer = (parentID)? eval('document.' + parentID + '.document.' + ID + '.document') : document.layers[ID].document;
    oLayer.open();
    oLayer.write(sText);
    oLayer.close();
    }
    else if (document.all) document.all[id].innerHTML = sText;
    }

    Example:

    If your div tag name is "PicLayer" and this layer is not nested within another then you can call the function like this:

    WriteLayer("PicLayer",null,"<img src='Images/your_pic.gif'>")


Bookmarks

Posting Permissions

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