开发者

Zend_Form not submitting

I built a custom Zend_Form "myForm" and I passed it to my view with:

$this->view->form=new myForm();

Problem: form is not submitting (page doesn't reload/refresh).I thought something was wrong with the "form" tags,but I copyied the bottom code in another page (that is not a Zend environment) and is working.This is the source code:

<form enctype="multipart/form-data" method="post" action="">

<input type="text" name="title" id="title" value="" class=""> 
<textarea name="text" id="text" class=""></textarea>
<input type="text" name="allegati" id="allegati" value="" class="">
<input type="hidden" name="MAX_FILE_SIZE" value="2097152" id="MAX_FILE_SIZE">
<input type="file" name="file" id="file" class="media[]">&l开发者_运维知识库t;/span>

<input type="submit" name="submit" id="submit" value="submit" class="">
</form>

SOLVED: As some of you guys suggested javascript is giving problems: I had a js script overriding with:

$('form').submit();

Thanks

Luca


Form submitting issues are 99% related to javascript conflicts with the 'form' element or with a wrong defined 'form' tag. Always check those above when encountering problems.

P.s. for the remaining 1% feel free to ask at Stack!

Best regards


Just a suggestion - try to rename your submit button to something but not "submit" (i.e name="mysubmitbutton"). I think the problem could be with expandos: http://ejohn.org/blog/deadly-expandos/. By default, a form element has a submit function. But, if you call any field inside your form with the name "submit" (like you do in your example), the form.submit will point to your input element and you'll not be able to submit your form.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜