View Full Version : Post variables with javascript

10-17-2003, 08:06 PM

I was wondering whether it is possible to post variables using javascript.

Let me explain: I've got a form and when the form is submitted a javascript function is called. This function reads the values and modifies them. Currently the modified values are being being submitted by the javascript using the get-method (a string with the variables is constructed).

What I now would like to do is submit the values with javascript using the post-method. Is this possible and how do I do that?

Thanx, Michiel

10-17-2003, 08:34 PM
Well, first of all, JavaScript doesn't submit anything. HTML and HTTP do it.

So, if your form is method POST, and you populate form elements with the data you want before submitting it (probably use hidden elements), then it will be sent.