In the following code:
[code=html]
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
<html>
<head>
<title>Button Size and Submit Test</title>
<style type=”text/css”>
.btn {
background:yellow;
width:10em;
}
.btnB {
background:blue;
color:white;
width:10em;
display:block;
}
</style>
</head>
<body>
<h1 align=”center”>Button Size & Submit Test</h1>
<form onsubmit=”return false”>
<!– Above is fix to prevent auto-submit if not IE browser –>
<!– form –>
<!– Above causes NS to RESET form back to original conditions –>
<!– substitute DIV for FORM here !!! DOES NOT WORK WITHOUT FORM TAG –>
<!– DIV –>
<table border=1>
<tr>
<td>
<input type=”text” name=”total1″ value=”0″ size=”5″><br />
<button name=”Add1″ onclick=”total1.value++”>Addition</button><br />
<button name=”Sub1″ onclick=”total1.value–“>Subtraction</button>
</td>
<td>
<input type=”text” name=”total2″ value=”0″ size=”5″><br />
<input type=”button” name=”Add2″ value=”Addition” onclick=”total2.value++”><br />
<input type=”button” name=”Sub2″ value=”Subtraction” onclick=”total2.value–“>
<!–
trying to make buttons the same width SIZE
adding size=”20″ to INPUT or BUTTON statements above has no effect!>
–>
</td>
<td>
<input type=”text” name=”total3″ value=”0″ size=”5″><br />
<button class=”btn” name=”Add3″ onclick=”total3.value++”>Addition</button><br />
<button class=”btn” name=”Sub3″ onclick=”total3.value–“>Subtraction</button>
</td>
<td>
<input type=”text” name=”total4″ value=”0″ size=”5″><br />
<button class=”btnB” name=”Add4″ onclick=”total4.value++”>Addition</button>
<button class=”btnB” name=”Sub4″ onclick=”total4.value–“>Subtraction</button>
</td>
</tr>
</table>
</form>
<!– /DIV –>
<!– Why does form not RESET with REFRESH in IE ??? Does OK in NS –>
</body>
</html>
would [B]someone be so kind
Questions and assumptions about above code in different browsers:
1.
Non-IE browsers seem to reset page if “onsubmit=return false” is not included in <form> tag. Does not seem to matter with IE. Correct?
<form> tag cannot be replaced by <div> tag and expect actions to remain the same. Correct?
You cannot control the size (width) of a BUTTON without using using CSS. Correct?
Is ‘display:block’ a correct method to force vertical (vs horizontal) button display in ‘.btnB’ CSS?
Why does NS reset page with F5 (refresh) but IE does not? What is different here when changes have been made to text box?
I hoping I have posted this to the correct forum.
I realize it contains a smidgen of HTML, Javascript, CSS and browser specific questions.
If not posted to proper forum, perhaps the moderators can re-direct my questions to the proper area.
Thanks in advance for any full or partial responses. ?