...

View Full Version : Text field disappears when page reloads



memoir
01-30-2007, 07:09 PM
Here's my page for reference:http://loudflower.com/p-29-true-colors-ls-teebrwoman.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

Arty Effem
01-31-2007, 08:37 AM
Here's my page for reference:http://loudflower.com/p-29-true-colors-ls-teebrwoman.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.

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.

memoir
01-31-2007, 09:44 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum