Reputation: 1746
I have the below form:
<form action="test.php" method="POST" onsubmit="loadXMLDoc(this.form); return false;">
<input class="com" type="text" name="test" />
</form>
Instead of "this.form", what would need to be in its place so that the text input by the user is passed to loadXMLDoc?
Also: is that the correct syntax to then send this variable data?
function loadXMLDoc($testVariable)
//standard ajax code..
xmlhttp.send("test=" + $testVariable);
Upvotes: 0
Views: 50
Reputation: 191829
The form can reference input elements by name as properties.
loadXMLDoc(this.test.value);
Upvotes: 1