开发者

submit form - jquery problem

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 c开发者_StackOverflowlick 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&amp;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.


What you may be meaning to do is listen to the submit event of the form itself. Try .submit() http://api.jquery.com/submit/

Edit: However, the .click() callback does occur before the form is submitted, so the problem could be in the manner in which you are setting your inputs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜