简体   繁体   中英

Posting Multiline EditText from Android to PHP to DB

I have a box where a user can input a sentence and send it to a database along with their personal information. I need to have a multiline box so that a sentence or short paragraph can be entered and sent. I am able to send the sentence to the table, but if I go over one line, the data is not received by the db. I can type a full line (just one) sentence in the box, and that will be received just fine by the db, but if I go to a second line, nothing is received (not even the personal info). Any ideas why?

Here is my code for the multiline box:

<EditText
    android:id="@+id/incidentDescription"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView2"
    android:layout_centerHorizontal="true"
    android:layout_margin="3dp"
    android:height="100dp" 
    android:gravity="top">

    <requestFocus />
</EditText>

It might be because you haven't set android:inputType="textMultiLine" . The default behavior of EditText is to allow only 1 line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM