0

I'm trying to get a text from user. But i couldn't do it. It all the time returns null. My code is :

HTML :

<form action="gorev" method="post">
    <textarea id="gorev" rows="4" cols="50">

    </textarea>
    <input type="submit" value="ekle">
</form>

AND SERVLET :

String gorev = request.getParameter("gorev");
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

2 Answers2

1

Replace

<textarea id="gorev" rows="4" cols="50">

with

<textarea name="gorev" id="gorev" rows="4" cols="50">
Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
1

If you need to read request.getParameter("gorev"); from the request in your server, should have a form element (input,select,textarea,radio button, checkbox,etc) with name = "gorev". ids are used on the client side (usually by javascript for DOM manipulation and css for styling.) They will be not send to the server unlike name

<textarea name="gorev" id="gorev" rows="4" cols="50">
</textarea>
Mukesh Keshu
  • 467
  • 2
  • 13