Home Onclick event of a certain page, perform POST action of other page
Reply: 0

Onclick event of a certain page, perform POST action of other page

user1203
1#
user1203 Published in May 21, 2018, 11:18 am

Let me explain my problem with a scenario:
I have webpages "A.jsp" and "B.jsp". "B.jsp" is a page with a form that requires input field, 'username' and on submission displays a certain page "C.jsp" with user-specific information. "A.jsp" has table with an element that would correspond to 'username' on "B.jsp". Onclick of a certain 'username' on "A.jsp", I want to be redirected to "C.jsp" with clicked username specific information.

How do I get it done?

I am using MVC framework. Only A.jsp and B.jsp are tied to controller, C.jsp is only a View. But, I believe that is less of an issue, since this seem to be more of a javascript question.

Using prototype javascript framework, I have tried the following:
redirectToC=function(pageurl){
var username=document.getElementById("user1").value;
url=pageurl; //I am using B.jsp as Pageurl
$j.ajax({ type: 'POST',
url: url, data: "username="+username,
success: function(request){
window.location=request;
}
});
}

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.387217 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO