Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 07-31-2004, 05:09 AM
  #1
pixelwraith
Veteran (Level 7)
 
Join Date: Apr 2004
Posts: 61
iTrader: (0)
pixelwraith is on a distinguished road
<body onload>

im wondering if the onload in the body tag can sometimes be disabled as Form1 is created dynamically and is not always displayed causing an error symbol in the bar at the bottom of the page

<body onload="document.forms['Form1'].reset(); document.Form1.username.focus();">
pixelwraith is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-31-2004, 05:58 AM
  #2
¥åßßå
Blonde Bimbo
 
¥åßßå's Avatar
 
Join Date: Jul 2004
Posts: 2,415
iTrader: (0)
¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all
try:-
<body onload="if(document.forms['Form1']){document.forms['Form1'].reset(); document.Form1.username.focus()}">
¥åßßå is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-31-2004, 08:40 AM
  #3
AaronCampbell
Resident PHP OOP Master
 
AaronCampbell's Avatar
 
Join Date: Aug 2003
Location: Chained to my computer
Posts: 1,619
iTrader: (0)
AaronCampbell is on a distinguished road
or, when you dynamically create the form, create the commands then too...like this:
Code:
if you are using php(I saw username, so I thought it might be validated server-side):
if(whatever){
//code that creates your form
echo "<script type=\"text/javascript\" language=\"javascript\">";
echo "<!--";
echo "document.forms['Form1'].reset();";
echo "document.Form1.username.focus();";
echo "//-->";
echo "</script>";
}

if you are using javascript to make the form:
if(whatever){
//code that creates your form
document.forms['Form1'].reset();
document.Form1.username.focus();
}
Then you would remove the onload command.
AaronCampbell is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-31-2004, 10:23 AM
  #4
pixelwraith
Veteran (Level 7)
 
Join Date: Apr 2004
Posts: 61
iTrader: (0)
pixelwraith is on a distinguished road
thanks!
pixelwraith is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 04-24-2009, 07:17 AM
  #5
ernestto
Novice (Level 1)
 
Join Date: Apr 2009
Posts: 1
iTrader: (0)
ernestto is an unknown quantity at this point
I need to do it in Joomla, I setup .js file but I dont know LOAD it in template
Any idea?
ernestto is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 08:22 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.