Try putting onLoad="show()" in your BODY tag instead of having it inline in your javascript and see if it makes any difference. This ensures that your whole page is loaded before the javascript function starts referencing page elements.
Regards: Ayudh +--------------------------------------------------------------+ | Turn on your Revenue Stream... | | Bolt on a Virtual Cash Register to your e-commerce site now. | | VeriPay from Xilo Online: http://www.xilo.com | +--------------------------------------------------------------+ ----- Original Message ----- From: "James Silva" <[EMAIL PROTECTED]> To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 11:00 Subject: [cfaussie] OT: javascript and the back button > Firstly, i apologise for being the source of most OT posts for the last couple > of days... this will be my last for the week. Promise. Although, Taco's thread > seems to be catching up nicely... aaaaannnnywayyy :) > > heres the prob... > > I've got a simple HTML form... certain form elements are hidden based on a radio > button selection. Im doing this with javascript/onClick and switching the > "style.display" property (simple stuff). > > When the user submits the form and uses the BROWSER's back button... each form > value retains its selected/typed value (as it should). But(!) my form elements > (which should be turned on based on the selected radio button) are always > hidden. > > Heres the javascript: > ///////////////////////////////////// > function show() { > if (document.getElementById){ > if(document.almanac.almanacTypeid[1].checked) { > document.getElementById("eventstuff").style.display = "block"; > }else{ > document.getElementById("eventstuff").style.display = "none"; > } > } > } > show(); > ///////////////////////////////////// > > As you can see, i call the show() function when the page loads. But when the > browsers back button is used, its not called... why? anyone? how can i get > around this? am i dreaming? where am i? hello..? > > cheers, > _______________________ > James Silva > Web Production > Gruden Pty Ltd > > Tel: +61 02 9956 6388 > Fax: +61 02 9956 8433 > Email: [EMAIL PROTECTED] > Web: www.gruden.com > _______________________ > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MX Downunder AsiaPac DevCon - http://mxdu.com/ --- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/
