• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: <c:out value="${row.lastname}" /></td>
<tr><td>Borrower ID: <c:out value="${row.lastname}" /></td></tr>
<tr><td>Borrower Name: <c:out value="${row.religion}" /></td></tr>

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

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

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

</body>
</html>
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 147
Eclipse IDE Tomcat Server Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You have to be odd to be #1 - Seuss. An odd little ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic