Would that even work Eddie? I seem to remember that if you didn't
explicitly set the width of an element yourself, you can't retrieve it.
Indeed, this quick test:
<html>
<body onload="alert(document.getElementById('b').style.width);">
<input type="button" id="b" value="this is a test">
</body>
</html>
...results in a blank alert in both IE and FF.
This only matters of course if you have to make all the buttons the same
width dynamically, but now I'm just curious! Is there a way to do it I
wonder?
Frank
Eddie Bush wrote:
Generally, what I will do to accomplish this is to use CSS. You can
either use incline styles in the "style" attribute, or you could specify
a style class with the styleClass attribute.
It would necessarily take a more contrived solution if you weren't able
to arrive at a fixed width for all buttons and had to use the width of
one button to determine the width of another button. In this case, I'd
probably use a combination of style IDs (to uniquely identify the
buttons whose width I wanted to modify), and JavaScript. You could then
setup an onload page handler that would determine the width of the
widest button, and use that to set the other button's width, using ...
again ... styles -- but added programatically, rather than explicitly.
For a button, whose style ID happens to be 'idMyButton', you could do
something akin to:
var myButton = document.getElementById('idMyButton');
myButton.style = "width: " + width + "px;";
----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Sunday, June 18, 2006 1:10 PM
Subject: How to set size of submit button
I am using html:submit for creating 4 sumit buttons. The requirement
is to
make them of same size. can anyone suggest how to do that?
regards,
Pankaj
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]