luca
luca

Reputation: 37136

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[]"></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

Upvotes: 0

Views: 651

Answers (2)

Sarah Ogbonna
Sarah Ogbonna

Reputation: 189

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

Upvotes: 1

ischenkodv
ischenkodv

Reputation: 4255

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.

Upvotes: 0

Related Questions