Form Mistery

They have: 5,633 posts

Joined: Jan 1970

When creating forms, I've notice that Explorer and Netscape show text fields in different lengths. Ekplorer displays them they way I intended, but Netscape shows them much larger, extremely large!!)

I've looked at some forms through both browsers on different sites and on some, it looks like they've managed to make Netscape display their text fields at the right size or a reasonable size.

Does anyone know how to remedy this problem?
If so...can you send me an example.

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

Do you use the size-property of an input type?
<input type=text size=20>

------------------
Jack Michaelson
[email protected]
! Click here for my profile !

Shakespeare: onclick || !(onclick)

They have: 76 posts

Joined: Apr 1999

visual1,

I've done alot of work with HTML forms. There is no easy solution for this. Even when specifying size and maxlength Netscape is always around twice as long as IE. Style doesn't work either on input tags(with Netscape) so style="width:20px" won't work.

What I've done is I use ASP. So I detect which browser the user has and give them a text field based on that. It's a little bit of extra work but it's worth it since it gives me uniform layout in both browsers. You could also use PHP for this if you're on a UNIX server.

This could be done with JavaScript also using document.write but it will be alot more involved.

Later,
PJ

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

JP-

I'm curious about your site.

They have: 5,633 posts

Joined: Jan 1970

You could always try playing around with the font setting for the text fields. I haven't tryed this myself but it might work. It is probably easier than setting up an ASP site to display different forms.

<style type="text/css>

INPUT {
font-family:verdana;
font-size:9pt;
}

</style>

If it works let us know.

------------------
http://go.to/hass

They have: 76 posts

Joined: Apr 1999

Jack,

I don't really have an Internet site, all my work is done on Intranet. If you want to see some work I've done with forms on the web go to either:
http://www.foodpricesonline.com or http://www.oralradiology.com

and find a page with a form on it. If you view source with IE and then Netscape you'll notice that the size of the input tags is slightly different for each browser even though it's the same page. The ASP source would be something like this:

<% Browser detect script goes here
%>

<html>
<head>
</head>
<body>
<form name=form action=action method=post>
<% If Browser = "IE" Then%>
<input type=text size=40>
<% Else %>
<input type=text size=20>
<% End If%>
</body>
</html>

It's that simple. I can't begin to stress how useful a tool this is. It's handy for so many other things besides input tags. I don't have to make separate pages for each browser everything is on one page.

Later,
PJ

They have: 472 posts

Joined: Oct 1999

Maybe you haven't set up the wat Netscape displays text correctly?

In IE 5, there is this "View > Text Size" menu item where you can set how large the text should be display.

Maybe you should check Netscape if there is such a thing too.

------------------
Goodbookmarks.com - Enjoy surfing the web once a day with us.
Submit Your Site Now!

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.