2 Replies - 175 Views - Last Post: 17 January 2013 - 06:56 AM

#1 Xna4life  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 21-February 12

<textarea> query

Posted 17 January 2013 - 05:33 AM

So the below code displays a table with the first column of each row displaying the desc, I want the user to be able to enter text into the 2nd column of each row, this works for the code below, but it displays a arrow at the end of each textarea allow the user to move up and down, all if i click anywhere in the textarea i will start typing on the space E.g if I click on the 10th space in the textarea and start typing the text will display there, I want to get rid of the arrow to the right of the textarea, ad when the user clicks on the textarea it will automatically move the cursor to the first space. any suggestions thank you
<form id="form2">
    <table>
        <tr>
            <td>List1</td>
            <td>
                <textarea name="1List" cols="20" rows="1">
                </textarea>
             </td>
        </tr>
        <tr>
            <td>List2</td>
            <td>
                <textarea name="2List" cols="20" rows="1">
                </textarea>
            </td>
        </tr>
         <tr>
            <td>List3</td>
            <td>  
                <textarea name="3List" cols="20" rows="1">
                </textarea>
            </td>
        </tr>
    </table>
    </br>
    </br>
    </div>
    </form>



Is This A Good Question/Topic? 0
  • +

Replies To: <textarea> query

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3610
  • View blog
  • Posts: 12,419
  • Joined: 12-December 12

Re: <textarea> query

Posted 17 January 2013 - 05:48 AM

As your textarea has only one row then much the better option is to use an input type="text".

Otherwise, you could use CSS overflow: hidden; to remove the scrollbar.

Moving the cursor to the front of the textarea could be achieved with Javascript, using the click or focus events. Personally, I would advise against this - it will be unexpected behaviour and can be quite annoying. If you want to do this you should post in the Javascript forum, but you will get a better response if you have already made an attempt yourself and created some code.

BTW You have an extraneous closing DIV tag and it is better to use CSS to create a gap rather than adding unnecessary BRs.
Was This Post Helpful? 1
  • +
  • -

#3 Xna4life  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 21-February 12

Re: <textarea> query

Posted 17 January 2013 - 06:56 AM

thats great thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1