Hello,
I’m currently using prototype in a user comments script to submit text to a database, however there is a limit on the amount of text that can be submitted via GET. I’d like to use method: “post”, but nothing I’ve tried has worked. I’m struggling…
my current javascript:
function ajax_test()
{
var url = "test_ajax_functions.php";
var data = "something=nothing";
var target = 'output';
function ajax_response(resp)
{
alert(resp.responseText);
}
var myAjax = new Ajax.Updater(
target,
url,
{method: 'post', parameters: data, onComplete: ajax_response}
);
}
simple html
<form id="form1" name="form1" method="post" action="" enctype="application/x-www-form-urlencoded">
<input type="text" id="text1" name="text1" value="nothing" />
<input type="button" name="Submit" value="Submit" onclick="ajax_test();" />
</form>
simple php
echo($_POST['text1']);
prototype is working, and this function works passing the variables as URI variables, and changing the method to ‘get’.
what am I doing wrong?
many thanks for any assistance.