I am trying to raise a click event on a submit button in a html form.
I use the .click() jquery to catch the click event and return true at the end of the function.
When I click on the submit button, the jquery functions are raised and a callback is executed, but the $_POST array is empty.
How can I fix this?
code:
<form action="index.php?p=searchexlibris&t=palabre" method="post" id="frmSearchexlibris">
<input type="text" name="palabre" id="palabre" value="" />
<input class="searchbutton" id="exlibrisbutton" type="submit" value="Buscar" />
</form>
In javascript functions:
$(‘#exlibrisbutton’).click(function(){
enableDisableFormExlibris(‘exlibrisbutton’,false);
return true;
});
In the function that catches the submit I get an empty $_POST, while the post works when I dont call the javascript function.
If you disable input fields and such in your javascript function before the data gets posted, it simply doesn’t put the values of the disabled input fields in the $_POST array.
One possible way to solve this would be sending them manually.