나는 JSP로 새로운 JSP 페이지를 처음 만들었습니다. 여기서는 사용자가 지정한 값을 낮은 텍스트 상자에 표시하도록 설정하려고합니다. 그러나 제출 후에도 null 값만 취합니다. 내 코드는 다음과 같습니다.왜 POST 매개 변수에 값이 적용되지 않습니까?
<form action="index.jsp" method="post">
<table>
<tr>
<td>Country</td>
<td><input id="countryText" type="text" > </td>
</tr>
<tr>
<td>City</td>
<td><input id="cityText" type="text" ></td>
</tr>
<tr>
<td>Check in Date</td>
<td><input id="checkinText" type="text" ></td>
</tr>
<tr>
<td>No of Nights</td>
<td><input id="noOfNightsText" type="text" ></td>
</tr>
<tr>
<td>No of Rooms</td>
<td><input id="noOfRoomsText" value="1" type="text" disabled></td>
</tr>
<tr>
<td></td>
<td align="right"><button id="searchButton" type="submit" class="buttonClass">Search Hotels</button></td>
</tr>
</table>
</form>
<table>
<tr>
<td>Country</td>
<td><input id="countryTextOutput" value="<%= request.getParameter("countryText")%>" type="text" disabled> </td>
</tr>
<tr>
<td>City</td>
<td><input id="cityTextOutput" value="<%= request.getParameter("cityText")%>" type="text" disabled></td>
</tr>
<tr>
<td>Check in Date</td>
<td><input id="checkinTextOutput" value="<%= request.getParameter("checkinText")%>" type="text" disabled></td>
</tr>
<tr>
<td>No of Nights</td>
<td><input id="noOfNightsTextOutput" value="<%= request.getParameter("noOfNightsText")%>" type="text" disabled></td>
</tr>
<tr>
<td>No of Rooms</td>
<td><input id="noOfRoomsTextOutput" value="<%= request.getParameter("noOfRoomsText")%>" type="text" disabled></td>
</tr>
</table>
내 웹 인터페이스
미리 감사드립니다 ..!
또한 입력에 이름 속성을 추가하십시오. – thexacre
@mit : 답이되어야합니다 (조금 더 정교한 경우). –
그것은 작동합니다. 고마워 많이 mit : :) –