3
Contributors
2
Replies
4
Views
11 Years
Discussion Span
Last Post by alpha_foobar
1

Use the "submit" method of the Form object. You should always give your form an ID:

<form id="myForm" action="myServerSideCode.php" method="post"></form>

Then, you can reference and submit the form with a script that looks like:

document.getElementById("myForm").submit();
0

It is possible to do much more than this. You can build your entire http send or post response, with message and header fields. And you can do it reasonably quickly using html DOM traversal by element type (which you can call on any html element or the html body element) and you can process the content of the elements using browser methods to make them URI compatible.

However you will need to build server side functionality to translate this. Alternatively you can build a client-side translator in JavaScript, but this is only efficient with small form elements (with content less than 250 characters).

This approach is very useful if you have a specific reason for it, but it is much more complicated than the technique described by Thomas.

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.