Hi,
I have a dynamic HTML form which is display to the user.
The above htm displays fine. But the problem is if one of the input element is empty then the alignment is bad. The problem is that the form is build dynamic at run time by java.
The question is how can I make sure the alignment is proper even if the input element is empty
Below is the code displays with bad alignment.
Help is appriceated. Wish you a Happy New Year.
Gorge
I have a dynamic HTML form which is display to the user.
Code:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
<style>
fieldset {
padding: 1em;
}
label {
float:left;
width:25%;
margin-right:0.5em;
padding-top:0.2em;
text-align:right;
}
</style>
</head>
<body>
<!--StartFragment -->
<form>
<fieldset>
<legend>Subscription info</legend>
<label for="name">Username:</label>
<input type="text" name="name" id="name" size="20"/>
<br />
<label for="mail">E-mail:</label>
<input type="text" name="mail" id="mail" size="20" />
<br />
<label for="address">Address:</label>
<input type="text" name="address" id="address" size="40" />
</fieldset>
</form>
</body>
</html>
The above htm displays fine. But the problem is if one of the input element is empty then the alignment is bad. The problem is that the form is build dynamic at run time by java.
The question is how can I make sure the alignment is proper even if the input element is empty
Below is the code displays with bad alignment.
Code:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
<style>
fieldset {
padding: 1em;
}
label {
float:left;
width:25%;
margin-right:0.5em;
padding-top:0.2em;
text-align:right;
}
</style>
</head>
<body>
<!--StartFragment -->
<form>
<fieldset>
<legend>Subscription info</legend>
<label for="name">Username:</label>
<!--<input type="text" name="name" id="name" size="20"/>-->
<br />
<label for="mail">E-mail:</label>
<input type="text" name="mail" id="mail" size="20" />
<br />
<label for="address">Address:</label>
<input type="text" name="address" id="address" size="40" />
</fieldset>
</form>
</body>
</html>
Help is appriceated. Wish you a Happy New Year.
Gorge