Web Hosting Forums

Results 1 to 5 of 5

This is a discussion on Integrating a form in a table in the Hosting Talk & Chit-chat forum
I've used forms in the past, but I've hit a problem now... I'm basically trying to integrate a form, with textfield and Submit button within ...

  1. #1
    Loyal Client
    Join Date
    Aug 2001
    Posts
    266

    Integrating a form in a table

    I've used forms in the past, but I've hit a problem now... I'm basically trying to integrate a form, with textfield and Submit button within a table with a small height (30 pixels).

    An extract from the code, which is very basic at the minute, is as follows:
    Code:
    <td width="220">                          
    <form method="post" action="">
    <input type="text" name="text" size="20">
    <input type="submit" name="Submit" value="Go!">
    </form>
    </td>
    It will eventually integrate with a search script, but I've hit a problem - putting this code in causes the design to go haywire - the tablerow almost doubles in height

    So far I've managed to discover that the <form> tag is interpreted as a new paragraph, so if I force a new paragraph just before (ie <p><form.... </form></p>) it works... well, in IE6 anyway However, I'm doubtful that this will work in older browsers. I've tried messing about with CSS, but so far I've only managed to give the textfield a lumious green border and pink text

    Any suggestions?

    Thanks,
    Andrew

  2. #2
    Loyal Client
    Join Date
    Dec 2001
    Posts
    53
    Hey there.

    I think the code I've included below can get you down to about 40 pixels. I hope it's helpful to you. I appears as if forms have a little buffer space at the top and bottom. I've always had a similar problem whenever I've tried to put forms in tight spaces. Anyway, maybe my code will be a little help to you I hope!

    Michael
    Got Beatles?

  3. #3
    Loyal Client
    Join Date
    Aug 2001
    Posts
    266
    Thanks for the reply... actually the problem has been solved. The code for this...

    Code:
    <table width="594" border="0" cellspacing="0" cellpadding="0"> 
    <tr> 
    <form name="form1" > 
    <td width="457"> 
    <input type="text" name="textfield" size="10" value="Search">
    <input type="submit" name="Submit" value="Go!"> 
    </td> 
    <td width="137"><img src="graphics/new/mb_r02_c5_pay.gif" width="137" height="30"></td> 
    </form> 
    </tr> 
    </table>
    The extra code is just what's been added... the secret to doing this is to put the form tags between the <tr> and </td> tags. It seems to work

    Thanks again for the reply.

  4. #4
    Loyal Client
    Join Date
    Dec 2001
    Posts
    53
    Glad you solved your problem because I forgot to include the code!!! Sorry about that!

    Michael
    Got Beatles?

  5. #5
    Loyal Client
    Join Date
    Aug 2001
    Posts
    266
    Originally posted by anthologyproject
    Glad you solved your problem because I forgot to include the code!!! Sorry about that!

    Michael
    Got Beatles?
    No problem

    Unfortunately, the client I'm designing the site for didn't like the search box where it had been placed (in the table) therefore all this trouble was for nothing

    Thanks again for taking the time to reply

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
  •