Author
how to get the value in the text area (jsp)
catherine bugayong
Greenhorn
Joined: Oct 09, 2011
Posts: 5
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: <c ut value="${row.lastname}" /></td>
<tr><td>Borrower ID: <c ut value="${row.lastname}" /></td></tr>
<tr><td>Borrower Name: <c ut value="${row.religion}" /></td></tr>
<tr><td>Borrower Address: <c ut value="${row.middlename}" /></td></tr>
<tr><td>Area Code: <c ut value="${row.firstname}" /></td></tr>
<tr><td>Load Balance: <c ut 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
Joined: Jan 28, 2008
Posts: 5575
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
Joined: Oct 09, 2011
Posts: 5
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
Joined: Aug 30, 2010
Posts: 147
posted Oct 10, 2011 11:23:42
0
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)
OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
catherine bugayong
Greenhorn
Joined: Oct 09, 2011
Posts: 5
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
subject: how to get the value in the text area (jsp)