Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2012
    Location
    chennai
    Posts
    55
    Thanks
    29
    Thanked 0 Times in 0 Posts

    PHP-form textarea dimension.

    Is it possible to change the width and height of textarea.If means please tell me how to do that.
    The following is my code.
    PHP Code:
    <tr>

                <
    td>
                
    Question<font color="red">*</font>
                </
    td>
                <
    td>
                :
                </
    td>
                
                <
    td><textarea name="ques1" id="ques1" cols="25" rows="5" style="resize:none;"></textarea>
                </
    td>
                <
    td>
                    <
    table>
                    <
    tr>
                    <
    td width="10">
                    <
    div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >
                    <
    input type="file" id="quest_wav1" name="quest_wav1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />
                    </
    div>
                    </
    td>
                    </
    tr>
                    <
    tr>
                    <
    td width="10">
                    <
    div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >
                    <
    input type="file" id="quest_img1" name="quest_img1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"   />
                    </
    div>
                    </
    td>
                    </
    tr>
                    </
    table>
                </
    td>
                <
    td>&nbsp;</td>
                
            </
    tr>
            <
    tr>
                <
    td>Page No<font color="red">*</font></td><td>:</td>
                <
    td><input type="text" name="pno" id="pno"  size="16" onkeypress="return isNumberKey(event, this.value)"/></td>
                <
    td>Chapter No<font color="red">*</font></td><td>:</td>
                <
    td><input type="text" name="cno" id="cno" size="16"  onkeypress="return isNumberKey(event, this.value)"/></td>
                </
    tr
    Please tell me i've to increase the size of textarea for the question field only. Please tell me how to do that.

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,301
    Thanks
    4
    Thanked 204 Times in 201 Posts
    Change the rows value for the textarea. This has nothing at all to do with PHP BTW.
    Dave .... HostMonster for all of your hosting needs

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by djm0219 View Post
    Change the rows value for the textarea. This has nothing at all to do with PHP BTW.
    Yep it sure doesn't. Moving to HTML/CSS forum.
    rows and cols are the attributes you want to set. I'm not really up with my html/css knowledge so I don't know if there is a more generic way to do it, but the rows and cols properties appear to still be a part of the html5 standard.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,640
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You should specify rows and cols on a textarea to define a default size for it. You can then override that using CSS if you need to (for those people whose browsers support CSS styling of forms).
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    New Coder
    Join Date
    Nov 2012
    Location
    chennai
    Posts
    55
    Thanks
    29
    Thanked 0 Times in 0 Posts
    Actually all the fields are inside a table. So by increasing the size or rows and cols attribute,all other fields move aside in a form.So is there any other option in table tag for doing this. Please tell me.
    Last edited by gayathri; 02-19-2013 at 06:13 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •