Expanding Text Boxes

openmind's picture

He has: 945 posts

Joined: Aug 2001

I have an INPUT text box that is displaying fine in IE 5.5 but is expanding way too much in NS 4.7 and making the cell way too wide.

Is ther a way to control the size of the text box that will work in both? Here's my code:

<cfoutput>
<table border="0" cellspacing="0" cellpadding="0" width="100%"
bgcolor="#dark#">
  <tr>
   <td>
    <table border="0" cellspacing="1" cellpadding="3" width="100%">
     <tr>
      <td bgcolor="#light#" align="center" class="alt">
Newsletter
      </td>
     </tr>
     <tr>
      <td bgcolor="white" align="center">
Subscribe to our FREE newsletter and recieve all the latest
        resources and site news delivered to your mailbox every month!
        <form action="pages/misc/newsletter.cfm?Action=Subscribe"
         METHOD="POST">
        <input type="text" name="email" size="18"
           value="[email protected]"><br><br>
<input type="Submit" value="Subscribe!">
</form>
       </td>
      </tr>
     </table>
    </td>
   </tr>
  </table>
</cfoutput>
'

Any ideas?

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

A couple of things to try.
One is to change the size of the textbox and add a maxlength field:

The other way that I have had some success with is to code like this:

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

mmi's picture

They have: 457 posts

Joined: Jan 2001

hey flipper - ya might want to wade through this thread from mmy hometown - I think it's come up recently here in the Woods as well

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

When I'm printing forms with a server-side language, I check the browser. If it's NN 4.7, then I print a size 1/2 to 1/4 the IE size.

...and yet another reason to ditch Netscape. The other being that AOL owns them. Mad

Mark Hensler
If there is no answer on Google, then there is no question.

detox's picture

They have: 571 posts

Joined: Feb 2001

This probably wont help much, but I wrap all of my form building into asp subs. These are little functions that I made to simplify thew building of forms. On my asp pages I now have only say 6 lines of code to generate 30 odd lines of HTML.

Anyway, the point is I have tied it in to the browser script so that if the displaying browser is netscape or anything else, I have a second value for the length of form fields etc. It simply means that any forms are as close to being crossbrowser in look than any other method.

openmind's picture

He has: 945 posts

Joined: Aug 2001

Thnx for the thread mmi,

I got it cracked by setting a form.input class up as width:120px and setting the size attribute for the form field as "10".

NS ignores the style but takes in the size, MS does the reverse!!

Sorted!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.