Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Bug #134 Problem with 'file' element, 'maxfilesize' rule and client side validation
Submitted: 2003-10-21 19:36 UTC
From: sokol_d at go2 dot pl Assigned:
Status: Bogus Package: HTML_QuickForm
PHP Version: Irrelevant OS: RH 9.0
Roadmaps: (Not assigned)    
Subscription  


 [2003-10-21 19:36 UTC] sokol_d at go2 dot pl
Description: ------------ I found a problem connected with 'maxfilesize' rule (probably other 'file' rules too) and client side form validation. The QuickForm class generates javascript version of this rule, which is broken (contains the reference to php function!! (!_ruleCheckMaxFileSize() ) and it breakes the whole js function validate_{form name}. For this and other file rules probably there should be no js validation at all. Reproduce code: --------------- This broken javascript contains: var value = frm.elements['photo'].value; var field = frm.elements['photo']; if (!_ruleCheckMaxFileSize('photo', value) && !errFlag['photo']) { errFlag['photo'] = true; _qfMsg = _qfMsg + '\n - Photo: File size must not exceed 50kb'; }

Comments

 [2003-10-21 20:42 UTC] mansion at php dot net
Don't use javascript for file validation.