• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

Controlling the maximum size of a form control?

I have an table which has the following row with the code:

                        <TR>
                              <TD WIDTH="10">
                              </TD>
                              <TD ALIGN="RIGHT" WIDTH="70">
                                    Function:
                              </TD>
                              <TD WIDTH="100" ALIGN="LEFT">            
                                    <SELECT id=select1 name=select1>
                                          <OPTION>Dallas
                                          <OPTION>Mississippi
                                    </SELECT>
                              </TD>
                              <TD WIDTH="170">
                              </TD>
                              <TD ALIGN="RIGHT" WIDTH="60">
                                    Severity:
                              </TD>
                              <TD WIDTH="100" ALIGN="LEFT">
                                    <SELECT id=select1 name=select1>
                                          <OPTION>Dallas
                                          <OPTION>Mississippi
                                    </SELECT>
                              </TD>
                              <TD WIDTH="10">
                              </TD>
                        </TR>

It works great but when the option value gets longer or shorter
the control gets out of wack position wise relative to the whole page.

Is there a way to set the maximum and minimum size of a control not to exceed
a certain value like the maximum width = 50 for the control?

Thanks
0
eric07
Asked:
eric07
  • 2
  • 2
1 Solution
 
TTomCommented:
If by control you mean the select box, IE will resize the content to match the longest item.  I don't think you can control it other than by limiting the size of the elements.

I don't remember how NS handles this.

Tom
0
 
Jan LouwerensSoftware EngineerCommented:
I beleive you can use style sheets to limit the sizes of elements, no matter what data is contained within them (although it may only work in IE)
0
 
TTomCommented:
jl:

Have you tried this with a <select> list?

Tom
0
 
Jan LouwerensSoftware EngineerCommented:
yes, actually, but ONLY in IE. But I can't find the style sheets I used... and I've forgotten how to do it... something like the source being the DOM path???
0
 
autCommented:
Paste this code. However, it will work for IE4.x, IE5.x and the upcoming Netscape 5. It will not work for Netscape 4.xx, as netscape lacks full stylesheet support.

Of course, you can change the width (i set it to 100) as you please.


 <TR>
  <TD WIDTH="10">
  </TD>
  <TD ALIGN="RIGHT" WIDTH="70">
   Function:
  </TD>
  <TD WIDTH="100" ALIGN="LEFT">
   <SELECT STYLE="width: 100;" id=select1 name=select1>
    <OPTION>Dallas
    <OPTION>Mississippi
   </SELECT>
  </TD>
 <TD WIDTH="170">
 </TD>
 <TD ALIGN="RIGHT" WIDTH="60">
  Severity:
 </TD>
 <TD WIDTH="100" ALIGN="LEFT">
  <SELECT STYLE="width: 100;" id=select1 name=select1>
   <OPTION>Dallas
   <OPTION>Mississippi
  </SELECT>
 </TD>
 <TD WIDTH="10">
 </TD>
</TR>


0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now