Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Text Field appearance

Quote Reply
Text Field appearance
Hi,

This is really an html question and I'm not sure if there is a GT forum for such questions but as this problem is related to my DBMan SQL html templates I will post it here.


I've noticed that different browsers (IE and Netscape)display the size of text fields on a form at different widths even though the size is specified in the html.
Is there anyway to control this?
It's causing me headaches with my table layout.
Also, the charset effects the text field width as well. My page is used with several different languages and an iso-8859-1 charset displays the widths diffrently to a UTF-8 and a Shift-JIS. Would it be advisable to set the charset to UTF-8 as it should work with almost every language?
Any advice would be most welcomed.
Thank you.
Simon.

Quote Reply
Re: [jai] Text Field appearance In reply to
Hi,

You should add the command below to print subroutine within Home.pm :

....
# Export home for using in auto generate HTML.
...
$args->{ie} = ($ENV{HTTP_USER_AGENT} =~ m,MSIE 5.5, or $ENV{HTTP_USER_AGENT} =~ m,MSIE 6,) ? 1 : 0;

And the textbox tags should be:
<input name="...." type="text" value="" size="<%if ie%>ie_size<%else%>ns_size<%endif%>">

I'm not sure about your second question, but I'll give it a try and will let you know later.

TheStone.

B.
Quote Reply
Re: [TheStone] Text Field appearance In reply to
Hi,
Cannot one just detect the browser type with a global? as in:

<%browser%>

sub {
my $tags = shift;
my $browser = ($ENV{'HTTP_USER_AGENT'});
if ($browser =~ /MSIE/) {
return "Internet Explorer";
}
if ($browser =~ /Mozilla/) {
return "Netscape";
}
return $browser;
}

It avoids modifying your gossamer code and it works for me! It's expandable to cope with other browser and to set type size parameters. Do you see any problem?

Last edited by:

charly: Sep 15, 2002, 11:17 PM
Quote Reply
Re: [charly] Text Field appearance In reply to
That's a good idea Sly

B.
Quote Reply
Re: [TheStone] Text Field appearance In reply to
Thanks for the browser info.

Any ideas about the best charset for international pages??

Thanks.

Simon.
Quote Reply
Re: [jai] Text Field appearance In reply to
It depends on the languages that you have. If you have Chinese or Japanese, then I guess you'll need utf-8. Otherwise iso-8859-1 would be sufficient.
kellner
Quote Reply
Re: [kellner] Text Field appearance In reply to
Unicode sounds like the way to go but am I limiting my accessability (OS and browser wise)?? I will be targeting users in their own language with a local version of their OS and browser (e.g Japanese with Japanese version of Win/Mac and Japanese version of IE/Netscape, etc.) so they should have the required fonts.
From my point of view (webpage developer) I need to deal with a language file that contains multiple languages and the only way I think that I can display and work with them all without displaying ???? is to have the file in unicode.
Thank you.
Simon.