...

View Full Version : textbox length changes between different browsers



camaross
04-08-2011, 05:05 PM
Is there a way I can set the length of the text box in terms of pixels (px), instead of using size="xx"?

In some rows, I have more than one textboxes, in others the whole row is a textbox. The textboxes I created using the below code look different in different browsers.

<input type="text" name=name size="25" maxlength="40"/>

Please help.

teedoff
04-08-2011, 05:11 PM
Is there a way I can set the length of the text box in terms of pixels (px), instead of using size="xx"?

In some rows, I have more than one textboxes, in others the whole row is a textbox. The textboxes I created using the below code look different in different browsers.

<input type="text" name=name size="25" maxlength="40"/>

Please help.

Shouldn't name=name actually be name="name"?

Can you post a link to your live site?

Dormilich
04-09-2011, 08:29 AM
Shouldn't name=name actually be name="name"?
that is allowed in HTML, as long as there are no spaces and other special characters in the attribute value.

oesxyl
04-09-2011, 08:34 AM
Is there a way I can set the length of the text box in terms of pixels (px), instead of using size="xx"?

In some rows, I have more than one textboxes, in others the whole row is a textbox. The textboxes I created using the below code look different in different browsers.

<input type="text" name=name size="25" maxlength="40"/>

Please help.
i guess you talk about bw-contact, all the markup from html files is invalid. Is a usual habit of many programmes to write code in php, perl or javascript and mess css and html.
You need to validate all the files from html folder and then to fix how it look.

best regards

_Aerospace_Eng_
04-09-2011, 09:15 AM
Is there a way I can set the length of the text box in terms of pixels (px), instead of using size="xx"?

In some rows, I have more than one textboxes, in others the whole row is a textbox. The textboxes I created using the below code look different in different browsers.

<input type="text" name=name size="25" maxlength="40"/>

Please help.

Getting back on topic, browsers use different font sizes and font families for inputs. To get a more uniform look set a font family and the font-size. You may even want to set the margin and/or padding. And you can set the width. Have you heard of CSS? :eek: Use CSS to set the width. You could even change the border if you like.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
input {
font-size:12px;
font-family:Verdana, Geneva, sans-serif;
margin:2px;
padding:2px;
width:200px;
border:1px solid #000;
/* remove the below or float this if you want text
and/or elements next to the inputs
this is here for markup purposes */
display:block;
}
</style>
</head>

<body>
<form>
<input type="text" name="name" size="25" maxlength="40" />
<input type="text" name="name2" size="25" maxlength="40" />
<input type="text" name="name3" size="25" maxlength="40" />
<input type="text" name="name4" size="25" maxlength="40" />
</form>
</body>
</html>

oesxyl
04-09-2011, 09:34 AM
Getting back on topic, browsers use different font sizes and font families for inputs.
op didn't said but he talk about bw-contact, and in this case fixing html doesn't help because will break the rest of the script who need to parse the html, so this is the topic. Anyway in case i'm wrong op can confirm this.

best regards

_Aerospace_Eng_
04-09-2011, 06:12 PM
op didn't said but he talk about bw-contact, and in this case fixing html doesn't help because will break the rest of the script who need to parse the html, so this is the topic. Anyway in case i'm wrong op can confirm this.

best regards

What? What are you referring to when you say "bw-contact"? He asked how to get uniformed input boxes that are the same across multiple browsers. To that you set the font size, and font family, you can even set widths and other styling if you prefer.

oesxyl
04-09-2011, 06:22 PM
What? What are you referring to when you say "bw-contact"? He asked how to get uniformed input boxes that are the same across multiple browsers. To that you set the font size, and font family, you can even set widths and other styling if you prefer.

http://cgi.bw.org/bw-contact/

op try to solve a bigger problem by assembling solution for different pieces.

best regards

_Aerospace_Eng_
04-09-2011, 06:34 PM
So are you saying why should he try to "reinvent" the wheel or something when there are forms already made out there?

oesxyl
04-09-2011, 06:47 PM
So are you saying why should he try to "reinvent" the wheel or something when there are forms already made out there?
he work on something more complex then this script, i have no idea what and i didn't ask, but i help him to change some parts of the script. First time when i seen the html i was tempted to make it valid then i realised that is parsed by the script and if i change it i need to change also the part of the code who use this pages, so i give up since was not important in that moment.
Anyway the script is better then many php i seen until now, :)

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum