CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • File fields are erased when validation of Contribution page fails
Pages: [1]

Author Topic: File fields are erased when validation of Contribution page fails  (Read 714 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
File fields are erased when validation of Contribution page fails
March 11, 2010, 12:24:14 pm
Let's say you have a Contribution page with a Profile, and in the Profile is a field of type "file".  If the validation fails (say because the person forgot to enter a required field) which happens all the time, the CiviContribute page dutifully remembers all the Profile data EXCEPT for the file path.

Try it here on the demo site:
http://drupal.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1

Is there any way that the form could remember the file browse... path on validation failure?  Is this a simple bug or a complex something that has hampered Contribution pages for a long time?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: File fields are erased when validation of Contribution page fails
March 11, 2010, 02:10:01 pm

i think this is an html input issue. i dont think file upload buttons can have default values

the other solution would be to actually do the upload and tell the user that a file has been uploaded and make that optional. but thats a much more difficult and longer fix

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: File fields are erased when validation of Contribution page fails
March 11, 2010, 03:07:18 pm
You're right, <input type="file" ...> has no default value (like other HTML input types do).  It seems that Drupal CCK fields work how you describe, it actually uploads the file when the form is submitted, even if validation fails.  This seems like a big hassle to replicate this behavior with CiviCRM, so I guess we should probably just live with it.  Thanks anyhow.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • File fields are erased when validation of Contribution page fails

This forum was archived on 2017-11-26.