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.

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

Comments
thanks

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

This article has been dead for over six months. Start a new discussion instead.