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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 02-11-2007, 07:38 PM Default Input field
Average Talker

Posts: 19
Location: Canada
Trades: 0
Hi,

I have a page with several text inputs. The first few text inputs are filled in by GET variables, so I want the page it "default" to the 3rd or 4th input, so the user can just start typing, and fill in the 4th text field. I believe GOOGLE does this with their search field. Is there any way to do this?

Thanks a lot,
Scott
scott_g is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-11-2007, 10:16 PM Re: Default Input field
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
<input type="text" value="Some Default Value" name="Some Field Name" />

I think that's what you mean. I'm not really sure I understand the question, though.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 02-12-2007, 12:07 AM Re: Default Input field
Average Talker

Posts: 19
Location: Canada
Trades: 0
Hi,

thanks for the reply, but thats not quite what I meant, I should have clarified it a bit i guess, its difficult to explain.

I'll use Google as an example. When you load the Google home page, you can start typing as soon as it loads, and your text automatically goes in the search field. When I make an input in an HTML form, I have to click on the input before I type, or the text won't enter the field. i want to specify which field i want the user to be able to type in as soon as the page loads; if the user starts typing without clicking on anything.

Hope that clears it up a bit...

Thanks,
Scott
scott_g is offline
Reply With Quote
View Public Profile
 
Old 02-12-2007, 12:38 AM Re: Default Input field
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
What you need to do is attach a javascript function the body.onload event and use it to set focus on the input field you want ( using document.getElementById ).
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 02-12-2007, 12:52 AM Re: Default Input field
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Ahhh. I see what you mean.

Alternatively to what Forrest suggested, document.name_of_form.form_field.focus() will do the job as well.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Default Input field
 

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.22115 seconds with 12 queries