• Post Reply Bookmark Topic Watch Topic
  • New Topic

can not get the values from textbox  RSS feed

 
Ramya reenu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to retrive the value of a textbox using scriplets.

<form name="frmdisplay">
<input type="text" name="txtFileBrowse" value=" ">
<% String fileName=request.getParameter("txtFileBrowse"); %>
<input type="text" value="<%= fileName%>" name="test">

i am getting only null value.

thanx in advance :roll:
 
Satish SN
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramya,

looking at the problem i understodd why null is coming bcoz for the first time the page is loaded there would be no txtBrowseFile parameter so it returns null and ur assinging the value to the text field

further u can reply
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramya reenu:
I am able to retrive the value of a textbox using scriplets.

<form name="frmdisplay">
<input type="text" name="txtFileBrowse" value=" ">
<% String fileName=request.getParameter("txtFileBrowse"); %>
<input type="text" value="<%= fileName%>" name="test">

i am getting only null value.

thanx in advance :roll:


Thats exepected behaviour. You are trying to read a parameter from request object but not from the text box, so it wont work. And you can not do it with Java code to read a text box value and assign that value for another text box. You need use Javascript code.
 
Ramya reenu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sathish,

i am passing a value to the textbox from another frame dynamically and i able to view the value in the texbox but not able to get the in java.

How can i do it.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramya reenu:
sathish,

i am passing a value to the textbox from another frame dynamically and i able to view the value in the texbox but not able to get the in java.

How can i do it.


YOu can do it in java using request object until unless you submit the form.
 
Ramya reenu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Reddy,

thank you. then i will try doing it in javascript and then get back.
 
Ramya reenu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi reddy,

thank u.
it is working now.


ramya
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramya reenu:
hi reddy,

thank u.
it is working now.


ramya


Thats good. Thumb rule is you can mis html code with Java but not Java code with html.
[ February 23, 2006: Message edited by: KJ Reddy ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!