Unanswered: self post the page and move to another page
I have web page in tab fashion where each tab is an image <a href> to move to another page, Now i want to first self post this current page and then through response.sendRedirect(URL) move to another page which is being clilcked represented by the image. Currently the page contains a form and a button upon whose click a new record is being displayed on the same page after a self post. I hope I am able to make my problem clear....Please suggest...thnx in advance
Well, it sounds like after a user clicks on any of the anchors you are
submitting the same page, via the <form action=""> tag. So, you'll
need to capture the values that you are sending on the re-submisssion
(getParameter() or getParameterValues(), depending upon the HTML
object) and prepare the HTML accordingly.
For instance, if the user clicked on a "checkbox" object whose name
is "cb1", you'll need to capture that the value was selected/checked and
have it selected when your server-side language re-generates the page.
Is I have not grasped what your problem really is, submit your code
that is causing you problems.
Actually I want to post my form on Anchor Href which seems to be difficult to me. I want to send the form data to some file by posting it and then move to another page represented by the link <a href> tag.
I have tried giving it through querystring by appending the page name after self page name but then the page does not get self posted...
You want to perform a form "submit()" when one or more anchors are
selected and pass the URL info contained in that anchor?
1) On the anchor's "onClick()" event, call your JS function.
2) In this function...
a) Retrieve the href's info you desire and, possibly, assign it to
a "hidden" object in the form or use this info and assign it to the
form's <action> parameter.
b) Issue your form submission.
The entry in the "hidden" object will get passed to your new form and
you can use whatever server-side language your currently using to
retrieve the information you desire.