SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using a form in a sliced table

    Hi all,

    My Problem:
    I have created a header section of a webpage that I have sliced up in photoshop and have re-assembled in HTML (Dreamweaver). Within the header section (within one of the slices) I need to put an input box (search box). Obviously, I need to use a form when using an input box, but when I input the <form> tag within the HTML it messes the slices up and makes the header image look completely wrong. But, when I input the <input type="text"...> tag without using the <form> tag everything looks fine.

    Does anyone know why when using the <form> tag in a sliced image assembled with HTML it distorts it??

    Tryst

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Just use this in your form:
    HTML Code:
    <form style="display: inline;" action="/blah/" method="post">
    <!--form stuff here-->
    </form>
    Forms add a margin, so setting them to display inline instead of as block-level elements gets rid of that.

  3. #3
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh, excellent!!

    Just a quick question about quality design :-)

    What is the best to insert the <form> tag with a table? Is the following way...

    <form id="prod_search" style="display: inline;" action="search.php" method="post">
    <TABLE WIDTH=800 BORDER=0 CELLPADDING=0 CELLSPACING=0>
    <TR>
    <TD>
    <IMG SRC="templates/images/header_01.gif" WIDTH=251 HEIGHT=35 ALT=""></TD>
    <TD COLSPAN=3 background="templates/images/header_02.gif" WIDTH=494 HEIGHT=35 align="right">
    <font size="2" color="#FFFFFF">Product Search: </font><input type="text" name="search" size="20" maxlength="30" /></TD>
    <TD background="templates/images/header_03.gif" WIDTH=55 HEIGHT=35>
    </TD>
    </TR>
    <TR>
    <TD>
    <IMG SRC="templates/images/header_04.gif" WIDTH=251 HEIGHT=41 ALT=""></TD>
    <TD>
    <IMG SRC="templates/images/header_05.gif" WIDTH=307 HEIGHT=41 ALT=""></TD>
    </TABLE>
    </form>

  4. #4
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry about that, it seemed to have posted before I finished. Anyway, is it best to put the <form> tags outside of the table, or is best to build the form within the table?

    Cheers

    Tryst

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Tryst
    Sorry about that, it seemed to have posted before I finished. Anyway, is it best to put the <form> tags outside of the table, or is best to build the form within the table?

    Cheers

    Tryst
    Well, since your form is so simple it's probably best to keep it all inside of a table cell. If you were using a table to lay your form out, then the <form></form> tags should go outside of the <table></table> tags.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •