Superfly1611
12-15-2003, 07:45 AM
Hello,
I have a form on which there are 3 select boxes, they can each have a random width as they are dynamically generated.
Question...
I want these select boxes to be of equal width.
I'd like a javascript to detect which select box has the largest width and apply that width to them all.
I presumed it would go something like this....
var formElement = document.getElementById("Select1");
var l = formElement.width;
var formElement = document.getElementById("Select2");
if(formElement.width > l)
{
l = formElement.width;
}
var formElement = document.getElementById("Select3");
if(formElement.width > l)
{
l = formElement.width;
}
with l obviously being the maximum width of the 3 select boxes
unfortunately it would appear that width is not a valid property of a select box?
Can someone help me?
I have a form on which there are 3 select boxes, they can each have a random width as they are dynamically generated.
Question...
I want these select boxes to be of equal width.
I'd like a javascript to detect which select box has the largest width and apply that width to them all.
I presumed it would go something like this....
var formElement = document.getElementById("Select1");
var l = formElement.width;
var formElement = document.getElementById("Select2");
if(formElement.width > l)
{
l = formElement.width;
}
var formElement = document.getElementById("Select3");
if(formElement.width > l)
{
l = formElement.width;
}
with l obviously being the maximum width of the 3 select boxes
unfortunately it would appear that width is not a valid property of a select box?
Can someone help me?