Old 27-02-2008, 22:15   #1 (permalink)
rustybones
corporate whore
 
rustybones's Avatar
 
Join Date: Oct 2007
Location: Umeå, Sweden
Posts: 247
Styling the form tag

So yeah I'm positioning my search field inside a header div and basically I want to ask, is it ok to use <form> tag to position it instead of wrapping the form in a div and then positioning the div?

Sounds like a dumb question I know but I'm curious, I don't want to fall into the world of "divitis"
  Reply With Quote
Old 27-02-2008, 22:37   #2 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
I don't see why not.

Don't forget to make it valid you have to have a block element around your form controls (inputs/labels/buttons). I usually use <div>s for that.
  Reply With Quote
Old 27-02-2008, 22:41   #3 (permalink)
rustybones
corporate whore
 
rustybones's Avatar
 
Join Date: Oct 2007
Location: Umeå, Sweden
Posts: 247
Really? so wrap div's around inputs to make them valid? That's the first I've heard of this... did I miss something?

So would this be invalid?

Code:
<form name="search-form" id="search-form" method="get" action="#"> <input id="search-box" name="search-box" type="text" value="type your search here" /> <button type="submit" id="search-submit">GO</button> </form>
  Reply With Quote
Old 27-02-2008, 22:44   #4 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Run it through the validator...see what happens.
  Reply With Quote
Old 27-02-2008, 22:48   #5 (permalink)
rustybones
corporate whore
 
rustybones's Avatar
 
Join Date: Oct 2007
Location: Umeå, Sweden
Posts: 247
Well fuck me sideways and call me Charlie! Thanks for the helpful tip mate, all valid code now I just wrapped a <fieldset> tag around the input and button tags
  Reply With Quote
Old 28-02-2008, 00:45   #6 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,537
Nice little tip on the fieldset tag - I've always used divs, but I never liked it because it felt like I was forcing it. The fieldset tag looks like what I need.

And to answer the original question, yes, you can use the form tag for positioning.
  Reply With Quote
Old 28-02-2008, 00:51   #7 (permalink)
rustybones
corporate whore
 
rustybones's Avatar
 
Join Date: Oct 2007
Location: Umeå, Sweden
Posts: 247
I think fieldset has to be one of those long forgotten tags, along with the <address> tag
  Reply With Quote
Old 28-02-2008, 03:04   #8 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,537
Long forgotten for some, newly learned for me!

I'm still such a rookie
  Reply With Quote
Old 28-02-2008, 04:01   #9 (permalink)
funkyprem
For all your goober needs
 
funkyprem's Avatar
 
Join Date: Dec 2004
Location: Coventry, UK
Posts: 1,528
a list anyone?
__________________
Time is really the only capital that any human being has, and the one thing that he can’t afford to lose. - Thomas Edison

prem ghinde
  Reply With Quote
Reply



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

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8