The code bellow will post it and in PHP you access it with $_REQUEST['somename']
Window.addEvent('domready', function(){
function sendPost(){
var values = $('input[name="database[]"]').map(function(e) { return e.value; });
new Request({
url: '<?php echo JURI::root();?>administrator/index.php?option=com_component',
method: 'post',
data: {
'somename': values
}
}).send();
}
});
However, it it's a form you would like to post you can do it in Mootools with Form.Request, see http://mootools.net/docs/more/Forms/Form.Request for more information.
If you add some more information I could probably help you a bit more when it comes to Mootools (not Joomla). For instance, you are not doing anything with the data coming back from the server.
Edit: There is another way to get the form data as well:
$('theForm').toQueryString().parseQueryString();
So you can use it as:
Window.addEvent('domready', function(){
function sendPost(){
new Request({
url: '<?php echo JURI::root();?>administrator/index.php?option=com_component',
method: 'post',
data: $('theForm').toQueryString().parseQueryString();
}).send();
}
});
Edit #2: You are aware that in your code in the example you do not call the function sendPost? so it actually don't do anything and does not have to be attached to the domready event.