0

hi all,

in javascript normaly page redirection can be done as follow with a parameter.

window.location = "add-new-cos.jsp?id="+id;

but this id value is send to the next page with in the GET method. but i want to send it with the POST method.

is there any way to do it with javascript....?

thanks..
janaka priyadarshana.

4
Contributors
4
Replies
12
Views
10 Years
Discussion Span
Last Post by NavedAhmed
1

hi all,

in javascript normaly page redirection can be done as follow with a parameter.

window.location = "add-new-cos.jsp?id="+id;

but this id value is send to the next page with in the GET method. but i want to send it with the POST method.

is there any way to do it with javascript....?

thanks..
janaka priyadarshana.

Yes, there is, and it is called AJAX. Search through the AJAX forums for posting values using JS with the POST method.

Another way is to create a hidden input element, use then JS to change the hidden element value and submit the form.
e.g. something like should work, however I have not tested it. If you're familiar with JS you will figure it out.

fucntion sendByPost(hiddenField)
{
var = myvalue;
var myHiddenfield = document.getElementById(hiddenfield);
myHiddenfield.value = myvalue;
document.form.submit();
}

Good luck

Votes + Comments
thanks
0

thanks for the idea. the second idea is the way that i wanted to know.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.