• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get the value in the text area (jsp)

 
catherine bugayong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there
how can I get the value of the textarea?

here is my code where I want to query in the database
<sql:query var="users" dataSource="${dataSource}">SELECT * FROM borrowers WHERE borrowerid ='"+borrowerid+"';</sql:query>

here is my complete code



<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/cashmate" user="root" password="root" />

<html>
<head>
<sj:head jqueryui="true" jquerytheme="south-street" compressed="false"/>
<jsp:include page="WEB-INF/fragments/globalHead.html"/>

<title>Cashmate <s:property value="#session.branch.branchname"/> - Loan Verification</title>

</head>
<body>

<c:if test="${sessionScope.auth == null || sessionScope.auth == false}">
<%--<jsp:forward page="index.jsp?auth=none"/>--%>
</c:if>
<s:div id="bodyContainer">
<s:div id="logoContainer" cssClass="ui-widget-content ui-corner-all">
<s:include value="WEB-INF/fragments/banner.jsp">
<s:param name="branch" value="#session.branch.branchname" />
</s:include>
</s:div>
<jsp:include page="WEB-INF/fragments/top.jsp"/>
<jsp:include page="WEB-INF/fragments/mainMenu.jsp?menu=Loan"/>
<jsp:include page="WEB-INF/fragments/left.jsp?type=loan&innerType=loanverification"/>


<div class="bg" style="background-color:beige;">
<!--method="get"-->
<form style="margin: 0 0 0 250px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Enter Borrower ID:</td>
<td><input type="text" size="20" name="borrowerid" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="B1" value="Submit" /><input type="reset" name="B2" value="Reset" /></td>
</tr>
</table>
</form>


<sql:query var="users" dataSource="${dataSource}">SELECT * FROM borrowers WHERE borrowerid ='"+borrowerid+"';</sql:query>

<sql:query var="users2" dataSource="${dataSource}">SELECT * FROM businesses; </sql:query>

<table style="margin: 10px 0 0 250px;">
<c:forEach var="row" items="${users.rows}">
<tr>
<td>Branch Code: <cut value="${row.lastname}" /></td>
<tr><td>Borrower ID: <cut value="${row.lastname}" /></td></tr>
<tr><td>Borrower Name: <cut value="${row.religion}" /></td></tr>

<tr><td>Borrower Address: <cut value="${row.middlename}" /></td></tr>
<tr><td>Area Code: <cut value="${row.firstname}" /></td></tr>

<tr><td>Load Balance: <cut value="${row.middlename}" /></td></tr>
</tr>
</c:forEach>

</table>
</div>
</s:div>
<%-- <jsp:include page="/WEB-INF/fragments/bottom.jsp"/> --%>

</body>
</html>
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch . next time Please use code tag while posting code, so that it can be easy to read.
das asd wrote:
how can I get the value of the textarea?

Use request.getParameter("textAreaName");
 
catherine bugayong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:Welcome to JavaRanch . next time Please use code tag while posting code, so that it can be easy to read.
das asd wrote:
how can I get the value of the textarea?

Use request.getParameter("textAreaName");


thanks for the quick reply

but how can I use it in this code?
 
Pete Nelson
Ranch Hand
Posts: 147
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about:



Of course, you'd probably also want to check for null, or invalid values as well (but that would be outside of your SQL code)
 
catherine bugayong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pete Nelson wrote:How about:



Of course, you'd probably also want to check for null, or invalid values as well (but that would be outside of your SQL code)


Thanks Pete
how about on the other page?



without going to that page
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic