Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 12-07-2006, 12:14 AM Auto focus form
Skilled Talker

Posts: 72
Trades: 0
I found some auto focus on input field using javascript but when I try using Firefox, the script dowsn't work like on IE.

Can any body tell me the auto focus script that compatible with IE, Firefox, and Opera
jaketmerah is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-07-2006, 10:44 AM Re: Auto focus form
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by jaketmerah View Post
I found some auto focus on input field using javascript but when I try using Firefox, the script dowsn't work like on IE.

Can any body tell me the auto focus script that compatible with IE, Firefox, and Opera
How about displaying the script that you have, including the way that you're using it.
logic ali is offline
Reply With Quote
View Public Profile
 
Old 12-07-2006, 03:09 PM Re: Auto focus form
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
I always use the onload attribute in the body tag:

<body onload="document.form_name.field_name.focus();">
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 12-08-2006, 10:59 AM Re: Auto focus form
foobar's Avatar
Extreme Talker

Posts: 225
Trades: 0
Try changing it to:

Code:
<body onload="document.forms['form_name'].elements['element_name'].focus();">
However, Opera doesn't support onload. To bypass that, add an inline JavaScript block.

Code:
<script type="text/javascript">
   document.forms['form_name'].elements['element_name'].focus();
</script>
foobar is offline
Reply With Quote
View Public Profile Visit foobar's homepage!
 
Old 12-11-2006, 11:47 PM Re: Auto focus form
Skilled Talker

Posts: 72
Trades: 0
I just found this and it work on IE, Opera, and Firefox

Put on body onLoad

Quote:
<body onLoad="self.focus();document.form1.username.focus ()">
Then on your form

Quote:
<form action="" method="post" name="form1">
<input type="text" name="username" size="20">
</form>
jaketmerah is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Auto focus form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14716 seconds with 12 queries