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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text field disappears when page reloads

    Here's my page for reference:http://loudflower.com/p-29-true-colo...eebrwoman.aspx

    The bottom half of the page has a blank shirt. You can upload a photo and it is resized and positioned using CSS. Then there is a text box. I have a simple script tied to the "Apply to Shirt" button that applies the text to another text box that is positioned over the shirt, again using CSS. The problem is that when clicking the button that says "Upload Photo/Update Price" the text over the shirt is no long there after the page reloads. I did try using the script to apply the text to the shirt when clicking the "Upload..." button and would see it briefly when clicking the button but again when the page reloads it's not there (though it has been captured for my purposes). I just don't want to confuse the user who might wonder if the text is really there at all.

    fwiw - the site is build using a .net shopping cart system. Each product is essentially displayed with the help of an XML doc. I've used CSS to design the look of the site. If it helps I could attach the XML doc for this page.

    I'm new to writing javascript and trying to learn but confused about this. Any tips/ideas for me would be appreciated.

    Thanks
    -Scott

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by memoir View Post
    Here's my page for reference:http://loudflower.com/p-29-true-colo...eebrwoman.aspx

    The bottom half of the page has a blank shirt. You can upload a photo and it is resized and positioned using CSS. Then there is a text box. I have a simple script tied to the "Apply to Shirt" button that applies the text to another text box that is positioned over the shirt, again using CSS. The problem is that when clicking the button that says "Upload Photo/Update Price" the text over the shirt is no long there after the page reloads.
    Try inserting this code within any existing script tags.
    Code:
    window.onload=function()
    {
    document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_18_TextOption_42.value
    }
    Such functionality is JS dependent and should have a server-side backup.

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Arty, thank you, thank you! A huge help and so simple. I was close in my prior attempts but missing the key ingredient - window onload function.

    -Scott


  •  

    Posting Permissions

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