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

Request #1971 Allow {jsVar} substitution in HTML_QuickForm_RuleRegistry::getValidationScript
Submitted: 2004-07-24 03:18 UTC
From: studio at peptolab dot com Assigned:
Status: Wont fix Package: HTML_QuickForm
PHP Version: Irrelevant OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-24 03:18 UTC] studio at peptolab dot com
Description: ------------ When creating a subclass of HTML_QuickForm_Rule, I was trying to reference the {jsVar} in my prefix code, however the HTML_QuickForm_RuleRegistry:: getValidationScript only performs a str_replace on the $jsCheck variable, not $jsPrefix. Is it possible to modify the code to allow substitution for the prefix? It does not matter if 'value' is a string/number or an array, as that can be determined on the client-side JavaScript. Reproduce code: --------------- Line 179-180: $js = $jsValue . "\n" . $jsPrefix . " if (" . str_replace('{jsVar}', 'value', $jsCheck) . " && !errFlag['{$jsField}']) {\n" . change to:- $js = $jsValue . "\n" . str_replace('{jsVar}', 'value', $jsPrefix) . " if (" . str_replace('{jsVar}', 'value', $jsCheck) . " && !errFlag['{$jsField}']) {\n" . Line 186-187: $js = $jsValue . "\n" . $jsPrefix . " var res = 0;\n" . change to:- $js = $jsValue . "\n" . str_replace('{jsVar}', 'value', $jsPrefix) . " var res = 0;\n" . Expected result: ---------------- To substitute the {jsVar} string with the name of the actual form element Actual result: -------------- Not implemented as yet

Comments

 [2004-10-10 14:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!