charlier Posted April 25, 2009 Share Posted April 25, 2009 Is there a way to do this with out java? I've come across this page -> http://webdesign.about.com/od/javascript/a/aa050701a.htm But I just don't really know how to mod this, or where to put it so it works. Any help here? Thanks, 0 Quote Link to comment Share on other sites More sharing options...
bear Posted April 25, 2009 Share Posted April 25, 2009 It's not Java, it's Javascript, and there isn't a way to do it with HTML as HTML is stateless. <body onLoad="self.focus();document.form.field.focus()"> 0 Quote Link to comment Share on other sites More sharing options...
charlier Posted April 25, 2009 Author Share Posted April 25, 2009 So, I'm trying to get this to work, should I put that code into say, my header.tpl file and replace the <body> tag? Thanks, 0 Quote Link to comment Share on other sites More sharing options...
bear Posted April 25, 2009 Share Posted April 25, 2009 That should work on any page that has a form and fields with that name and uses the header.tpl file. 0 Quote Link to comment Share on other sites More sharing options...
charlier Posted April 25, 2009 Author Share Posted April 25, 2009 Hmmmm, no dice. Do I need to put anything else in this at all? Just that one liner? Doesn't seem like it's working. Not the hugest deal, it's more of a want. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted April 25, 2009 Share Posted April 25, 2009 Two things to try: 1) Is there a form with the correct name on the page? This requires a form and fields named as they are in the js string: document.form.field.focus. 2) Seeing as you're adding this to a Smarty template, you may need to wrap it in {literal} tags, but that's completely untested. <body {literal}onLoad="self.focus();document.form.field.focus()"{/literal}> 0 Quote Link to comment Share on other sites More sharing options...
Impact-John Posted April 27, 2009 Share Posted April 27, 2009 Two things to try:1) Is there a form with the correct name on the page? This requires a form and fields named as they are in the js string: document.form.field.focus. 2) Seeing as you're adding this to a Smarty template, you may need to wrap it in {literal} tags, but that's completely untested. <body {literal}onLoad="self.focus();document.form.field.focus()"{/literal}> Works Great for me thanks Bear Two Thumbs Up 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.