Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am really stumped by this and maybe I have been looking at the script for too long, but can anyone help me in determining why my form controls are not resizing to use the full width of the containing div?

XML
<div class="container">
    <form action="/Home/DoQuoteMe" class="ajax" method="post" role="form">
        <div class="form-group">
            <label class="control-label" for="Name">Name:</label>
            <input class="form-control" type="text" id="Name" name="Name" placeholder="Your name here" required="">
        </div>
        <div class="form-group">
            <label class="control-label" for="Tel">Tel:</label>
            <input class="form-control" type="text" id="Tel" name="Tel" placeholder="Tel #" required="">
        </div>
        <div class="form-group">
            <label class="control-label" for="Cell">Cell:</label>
            <input class="form-control" type="text" id="Cell" name="Cell" placeholder="Cell #" required="">
        </div>
        <div class="form-group">
            <label class="control-label" for="Email">Email:</label>
            <input class="form-control" type="email" id="Email" name="Email" placeholder="your@emailaddress.com" required="">
        </div>
        <div class="form-group">
            <label class="control-label" for="Address">Address:</label>
            <textarea class="form-control" id="Address" name="Address" placeholder="Your address here" required="" rows="5"></textarea>
        </div>
        <div class="form-group">
            <label class="control-label" for="Comments">Comment:</label>
            <textarea class="form-control" id="Comments" name="Comments" placeholder="Your comments here" required="" rows="5"></textarea>
        </div>
        <div class="form-group">
            <button type="submit" class="btn btn-primary">Submit</button>
            <button type="reset" class="btn btn-default">Reset</button>
        </div>
    </form>
</div>

This is the link to a live example of my issue Fiddler example[^]. Any help will be greatly appreciated.
Posted

1 solution

The width of input controls is being set by line 236 in the bootstrap style sheet:
CSS
input,textarea,.uneditable-input{width:206px;}


You probably want something in your stylesheet like:

CSS
input { width: 100% !important }
 
Share this answer
 
Comments
nortee 2-Sep-14 21:12pm    
hi Yvan,

If I remove/add the style the styles still do not change. What you are saying is that I should change my input field class style to that? I will adjust and let you know how this chance works out.
Yvan Rodrigues 3-Sep-14 11:10am    
My suggestion of overriding the input size is the brute force method. The proper way would be to play nice with Bootstrap and use its column width specifiers.
nortee 2-Sep-14 21:13pm    
another thing.. how is it that the form control works @ resizing on my other site but not this one..
nortee 2-Sep-14 21:20pm    
Also, thought this was by default@ set the widths... My site stuff is built for the tool to just autamagicicaly work that out... I thought that was what it was about... I suppose we can't have everything... tis just strange...

If i have to do it like that then coo.... but still... sonds wierd... Either way... thank you so much for your time :)
Yvan Rodrigues 3-Sep-14 11:09am    
It you're using Bootstrap you should set your desired column width using the column width class specifier: http://getbootstrap.com/css/#grid-options

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900