PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 28th, 2006, 04:22 AM
trl trl is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 trl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
html_quickform uploadfile cleared on validation failure

windows xp, php5.2, pear 1.4.9, html_quickform 3.2.6

Hi Folks,

i have a form that has a file upload element and some other elements. i browse to a file and the filename is filled into to the left of the browse button. But when i submit the form that has other validation errors, the filename is not redisplayed when the form is redisplayed. This forces the user to have to re-browse each time they submit a form with another validation error (even if they had properly filled in the filename in the first place). What am i missing ? Has anyone seen and resolved this problem ? Thanks in advance!
ted

Here is a trimmed down script:

php Code:
Original - php Code
  1.  
  2. <?php
  3.  
  4. define('UPLOAD_DIR','uploads');
  5.  
  6. // load the PEAR HTML_QuickForm package
  7. require_once 'HTML/QuickForm.php';
  8.  
  9. // create form
  10. $form = new HTML_QuickForm('upload_test','POST' );
  11.  
  12. // required text form
  13. $form->addElement('text','text1','Text: ' );
  14. $form->addRule('text1','Enter some text.','required');
  15.  
  16. // upload file
  17. $args='size="40"';
  18. $file = $form->addElement('file','upfile','Upload file: ', $args );
  19. $form->addRule('upfile','Upload a file.','uploadedfile');
  20.  
  21. // submit button
  22. $form->addElement('submit','Submit','Submit');
  23.  
  24. // validate/process or (re)display
  25.  
  26. if ( $form->validate() )
  27. {
  28.     $form->process( 'save_data' );
  29. }
  30. else
  31. {
  32.     $form->display();
  33. }


Reply With Quote
  #2  
Old August 28th, 2006, 05:15 AM
DMN DMN is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 12 DMN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to DMN
RE: html_quickform uploadfile cleared on validation failure

It is no "POST Back" functionality in "file" and "password" fields. You will need to make it by yourself.

Reply With Quote
  #3  
Old August 28th, 2006, 06:23 PM
trl trl is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 trl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: html_quickform uploadfile cleared on validation failure

> It is no "POST Back" functionality in "file"
> and "password" fields.
> You will need to make it by yourself.

i'm not sure what you mean by "POST Back" functionality. Would you be able to point me to an example of doing this? THANKS!

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > html_quickform uploadfile cleared on validation failure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway