Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
| Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 4th, 2004, 04:40 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Regornil
Default Getting textbox value in jsp

Hi i need to get the the text in a textbox in jsp and store it in a hidden txtbox.How do i do tt?

  #2 (permalink)  
Old August 5th, 2004, 07:00 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

in servlet you can use the property such as getAttribute("txt boxName ")


  #3 (permalink)  
Old August 7th, 2004, 07:24 AM
Registered User
 
Join Date: May 2004
Location: Peshawar, NWFP, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MAK_NUST Send a message via Yahoo to MAK_NUST
Default

in case of jsp you have to code
request.getParameter("textbox name");
this will return a value in String.


Mohammad Asif Khan
Niit Distributive Computing Research group
Nust Institute of Information Technology
Email: asif_khan@ieee.org
  #4 (permalink)  
Old August 9th, 2004, 05:19 AM
Authorized User
 
Join Date: Apr 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to coitri Send a message via MSN to coitri Send a message via Yahoo to coitri
Default

to Regornil: when the textbox in a form, you can get its value by request.
Now I have a question:
in a JSP page, I have 2 information groups, displayed in 2 tabs. switching between that tabs by submit action. First, I input "h#7871;lô" into textbox in tab 1 then Submit. before submit, I save its value to a hidden item. then, after submit, I get value of hidden item, it don't match with before.
my JSP include:
<%@page contentType ="text/html;charset=UTF-8" %>
<%@page pageEncoding="UTF-8"%>

Give me your idea, many thanks in advance!

  #5 (permalink)  
Old August 17th, 2004, 02:17 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

U can refer to the sample Code

http://p2p.wrox.com/topic.asp?TOPIC_ID=17664



  #6 (permalink)  
Old August 17th, 2004, 08:25 PM
Authorized User
 
Join Date: Apr 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to coitri Send a message via MSN to coitri Send a message via Yahoo to coitri
Default

I found out solution for my problem.
On the top of JSP page, add <% request.setCharacterEncoding("UTF-8"); %>

That's all!

  #7 (permalink)  
Old August 18th, 2004, 04:54 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Regornil
Default

ok man..thx guys for the help! =]



Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox Help iceman90289 C# 2005 6 April 6th, 2008 03:54 AM
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
Please Help. mr_newreq.jsp:78: jsp:useBean can't f batken JSP Basics 0 February 22nd, 2006 09:56 PM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.