Forum
Form with file upload
Hi...
I'm having an issue with the file upload on the form, and I can't for the life of me work out what i've done wrong. The form submits fine if you don't attached a document, and I've try different documents and types. If you attached a doc the page just refreshes as if theres an error in a field, the files input goes back to blank but the others remain.
In the admin I'm not getting any issues with the form path... folder is 777. There's no alerts in the Diagnostics
Template code
<perch:form id="vacancies" method="post" app="perch_forms">
<perch:input type="text" id="name" required="true" label="Name" placeholder="Full Name" class="name" />
<perch:input type="text" id="number" required="true" label="Number" placeholder="Contact Number" class="tel" />
<perch:input type="email" id="email" required="true" label="Email" placeholder="Email Address" class="email" />
<perch:input type="textarea" id="coverletter" required="true" label="Cover Letter..." placeholder="Cover letter..." />
<perch:input type="file" id="cv" required="false" placeholder="Attached C.V (.doc, docx or pdf) " accept="doc docx rtf pdf" />
<perch:error for="name" type="required"><div class="error">Please add your name</div></perch:error>
<perch:error for="number" type="required"><div class="error">Please add your number</div></perch:error>
<perch:error for="email" type="required"><div class="error">Please add your email address</div></perch:error>
<perch:error for="email" type="format"><div class="error">Please check your email address</div></perch:error>
<perch:error for="coverletter" type="required"><div class="error">Please add a Cover Letter</div></perch:error>
<perch:input type="submit" id="submit" value="Send Application" />
<perch:success>
<perch:content id="success" type="textarea" label="Thank you message" textile="true" editor="markitup" />
</perch:success>
</perch:form>
Can any one see what i've done wrong?
Thanks
Can you post your diagnostics report?
You have:
Are those types defined as groups in your
config/filetypes.ini
file?As far as i can see they are...
I see
pdf
but not the others.Which type of file are you trying to upload?
I think you probably want
Perfect!
I'm an idiot, not done one of these since perch 1 and dint realise that accept= " " was for the group headings not the file extensions