Link to home
Start Free TrialLog in
Avatar of Manish
ManishFlag for India

asked on

passing HTML value to JSP

Frds,
   I want to pass selected value from HTML(may be Text or drop down)
to JSP code ?
Thanks in advance ...
karan
ASKER CERTIFIED SOLUTION
Avatar of hongjun
hongjun
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to print out the text, you do this

out.println(request.getParameter("Text1));


hongjun
Avatar of Nick_72
Nick_72

You will have to resubmit the page and retreve the parameter.

for example:

<%
  if (request.getParameter("myTextField") != null) {
%>   alert('Parameter found: <%=request.getParameter("myTextField")%>');
<%}
%>

<form method="post" name="myform" action="#">
  <input type="text" name="myTextField" onBlur="this.form.submit();">
</form>

/Nick
ignore my first comment on "request.getParameter("submit");"...
Avatar of Manish

ASKER

I want to use on same page without submitting ?
Is it possible?
For the same page, you can always use METHOD=get and submit to the same page.
To retrieve it, you do the same thing.
<form method="get">
...
</form>
>>I want to use on same page without submitting ?
>>Is it possible?

I'm afraid not.
Avatar of Manish

ASKER

But I have to remember all other selected value..
Is it possible to pass the value to javascript and use in
java code of jsp?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Manish

ASKER

So without sumit it is not possible?
that's right
Avatar of Manish

ASKER

Thanks hongjun and Nick..
U both cleared my problem...
There should be sharing points among u...
karan
There is a feature to share points ;) not now though, it's too late since it's already accepted.
No problem.

/Nick
@ee_ai_construct

OK. I am fine with the split if the questionner replies.

hongjun
Avatar of Manish

ASKER

How to share points ,Sorry I dont know?
Yeah.
Thank you guys, I appreciate it :)

/Nick