| sfYzAjaxValidationPlugin Support Page [message #37344] |
Fri, 12 October 2007 20:40  |
DrDrakken Messages: 80 Registered: January 2007 |
Member |
|
|
This will be the main form for the sfYzAjaxValidationPlugin Plugin. Please feel free to ask any question or give any suggestions regarding this plugin.
To view the plugin wikipage, please goto: http://trac.symfony-project.com/trac/wiki/sfYzAjaxValidation Plugin
|
|
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #37473 is a reply to message #37344 ] |
Mon, 15 October 2007 21:09   |
 |
enigma Messages: 94 Registered: March 2007 Location: Poland |
Member |
|
|
Forward also doesn't help. I try to find solution, but I'm beginner in symfony and it could be hard for me.
EDIT
more about redirecting of page. I found only one solution, in yzValidatorHelper::form_remote_tag I must add
'update' => array('success' => 'main'))
and this update
<div id="main">WHOLE CONTENT OF PAGE<div>
/EDIT
But I have one more question. When user pass wrong data to form, AJAX get message from validation file. But this message isn't UTF-8 .
[Updated on: Tue, 16 October 2007 07:54] Paweł Ryznar - programista JAVA :: Love IT - devBlog
|
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #37789 is a reply to message #37344 ] |
Fri, 19 October 2007 20:13   |
 |
enigma Messages: 94 Registered: March 2007 Location: Poland |
Member |
|
|
I found probably one more bug. In my routing.yml for each rule I add .html suffix.
And forms works ok. But when I delete this sufixs, and enable suffix in settings.yml forms doesn't work
when I delete form works correctly
Paweł Ryznar - programista JAVA :: Love IT - devBlog
|
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #39111 is a reply to message #37835 ] |
Thu, 08 November 2007 23:22   |
postman Messages: 77 Registered: June 2006 |
Member |
|
|
Hey.
This plugin is wonderful! Thanks!
But unfortunately the indicators feature don't work in my case. I did everything according to instructions. And Here is my form:
<?php echo use_helper('Validation') ?>
<?php echo use_helper('Javascript') ?>
<?php echo yzValidatorHelper::form_remote_tag(
array( 'update'=> 'result',
'url'=> 'pages/ask',
'script' => 'true',
'loading' => "Element.show('indicator')",
'complete'=> "Element. hide('indicator')",
'yzValidation_loading' => "Element.show('validation_indicator')",
'yzValidation_complete' => "Element.hide('validation_indicator')",
));
But when I submit the form, it redirects me without validation straight to the yzAjaxValidation module.
Any ideas on what is wrong?
Here is entire form: http://rafb.net/p/Jfqj2k83.html
[Updated on: Thu, 08 November 2007 23:24]
|
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #45627 is a reply to message #37344 ] |
Sat, 16 February 2008 11:32   |
 |
enigma Messages: 94 Registered: March 2007 Location: Poland |
Member |
|
|
I use form_remote_tag and have some problem,
in firebug in reasponse I get
<h1>[sfControllerException]</h1>
<h2 id="message">{sfController} controller "time_table/search" does not exist in: %SF_ROOT_DIR%/apps
/frontend/modules/time_table/actions, %SF_ROOT_DIR%/config/../../../symfony/data/symfony/modules/time_table
/actions</h2>
but time_table/search exist, if I use from without AJAX everything is ok
Paweł Ryznar - programista JAVA :: Love IT - devBlog
|
|
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #49277 is a reply to message #49255 ] |
Sun, 06 April 2008 01:18   |
djoos Messages: 290 Registered: August 2007 Location: London |
Faithful Member |
|
|
...my problem was solved by going once more over the steps described on the plugin's page. But I must say that I'd recommend the page to be updated:
instead of stating "Now copy the yzAjaxValidation folder located in sfYzAjaxValidationPlugin\web\js\ into your project's js folder", I'd suggest it to be "Now copy the contents of the myproject/plugins/yzAjaxValidation/web/ directory into your myproject/web/yzAjaxValidation/ directory"...
Thx for the plugin, it's great - I'm looking forward to see Symfony 1.1 in relation to Ajax validation though, but for now this is really the thing I wanted!
[Updated on: Sun, 06 April 2008 01:19]
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #49319 is a reply to message #37344 ] |
Sun, 06 April 2008 17:43   |
joethong Messages: 8 Registered: February 2008 |
Junior Member |
|
|
Hi,
Thanks for the superb plugin, we've been using it with no problems until recently when we put Chinese characters (UTF8) into the validation yml files. It works in Firefox, but in IE7, if chinese chars are in the JSON header and they have not been converted to Unicode code points (e.g /uDB34) prototype will complain that it is not a valid URI in line 1403. It took me a long time to realize this and since I can't find any readily available php script to encode the special characters in the Javascript Unicode code point format I resorted to the json_encode function that comes with PHP5.2. In addition to that, I did some inelegant hacks to the json_encoded string to remove the double quotes. I'm pasting my code here so that you coulde test it. You might need to find a way to do it elegantly and take backward compatibility into account.
Index: .
===================================================================
--- . (revision 502)
+++ . (working copy)
@@ -86,7 +86,14 @@
$error_name = sfConfig::get('sf_validation_error_id_prefix', 'error_for_').$error_name;
$JSON_output_ary[] = "['$error_name','$error_message']";
}
- $JSON_output = '['.implode(',',$JSON_output_ary).']';
+ //$JSON_output = '['.implode(',',$JSON_output_ary).']'; //Commented this line and added line 90-95
+ $JSON_output = json_encode($JSON_output_ary);
+
+ //JSON_output needs to look like [['error_for_username','message']]
+ //But after applying json_encode, it will look like this ["['error_for_username','message']"]
+ //We need to remove the " in of the first and last occurence.
+ $JSON_output = '[' . substr($JSON_output, 2, -2) . ']';
+
$this->getResponse()->setHttpHeader("X-JSON", '('.$JSON_output.')');
return sfView::HEADER_ONLY;
}
Regards
Joe Thong
|
|
|
|
|
|
| Re: sfYzAjaxValidationPlugin Support Page [message #50277 is a reply to message #50266 ] |
Fri, 18 April 2008 14:06   |
patrov Messages: 15 Registered: April 2008 Location: france |
Junior Member |
|
|
<?php
echo yzValidatorHelper::form_remote_tag(array(
'update' =>'comment_edit_section',
'url' => 'entreprise/updateTestAjaxform',
'yzValidation_loading' => "Element.show('indicator_while_validating)",
'yzValidation_complete'=> "Element. hide ('indicator_while_validating')",
'loading' => "Element.show('indicator')",
'complete'=> "Element. hide('indicator')", ));
?>
<div id='comment_edit_section'></div>
When I click on the submit button firebug also says that it find an error.
missing ; before statement
here is the javascript code
<form onsubmit="new Ajax.Request('/dev/Edupass/01/trunk/httpdocs/edupass_dev.php/yzAjaxValidation', {asynchronous:true, evalScripts:false, onComplete:function(request, json){yzAV_JSONUpdater(request, json, yzValidator_eval_onsuccess1805751553);}, onLoading:function(request, json){Element.show('indicator')Element.show('indicator_while_validating)}, parameters:Form.serialize(this)}); return false;" action="/dev/Edupass/01/trunk/httpdocs/edupass_dev.php/yzAjaxValidation" method="post">
SO When i click on the submit button i have a blank page for the module
I have an action named updateTestAjaxform, an other one named handleErrorUpdateTestAjaxform and my .yml file for the validation. The form works without ajax.
Thanks for the answer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|