Win a copy of Java Challengers this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

post hidden value to new window opened by javascript ?

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to post the hidden type value of a form to new window opened by javascript ?

In search.jsp

Q:I want to get "toobig" field value of search.jsp's form5 in action_out.jsp
but I got null.

[ May 09, 2007: Message edited by: qingwu wang ]
[ May 09, 2007: Message edited by: qingwu wang ]
 
Sheriff
Posts: 67528
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets.

This post has been moved to a more appropriate forum.
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please replace "on" with "onclick"
thanks a lot
 
Bear Bibeault
Sheriff
Posts: 67528
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a question?
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can probably use

this should invoke
request.getParameter("toobig");

HTH.

Garrett
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)parent window:
search.jsp
search.jsp including form5
2)the opened page by parent calling window.open
action_out.jsp which opened by window.open from search.jsp
3)In action_out.jsp,I want to get field "toobig" value of form5.
request.getParameter("toobig");
but return is null.
How can I?
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether search.jsp's FORM5 can be submited to action_out.jsp by the above method is KEY of question.
Sorry,I hope I can explain my question rightly.
[ May 09, 2007: Message edited by: qingwu wang ]
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

2)the opened page by parent calling window.open


That is why the parameter is not there.

If the request parameter is not submitted in the request, how can it be accessed in the JSP?

To solve this problem, submit the form to a new window.

1) use target="_blank" on the form. (easy)
2) use xhr to submit the form, then open a window with the response (complicated).

For a prototype, you could choose option 1.
For a real world scenario, you might choose option 2 and use a panel widget instead of a window.

HTH.

Garrett
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant in my earlier post
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks the above is OK!
another question:
detail.jsp

How to post value of detail.jsp to in.jsp?
I use http://www.test.com/in.jsp?key=value
but value is too big and open this page is too slow,even dead.
Can I done it by POST method?
[ May 10, 2007: Message edited by: qingwu wang ]
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know how you've set your frameset up.

target="mainFrame" should work.

Using an iframe would be easier.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you append the hidden value as a querystring value, than you would have it?

Eric
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic