This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » General plug-ins » sfYzAjaxValidationPlugin Support Page
sfYzAjaxValidationPlugin Support Page [message #37344] Fri, 12 October 2007 20:40 Go to next message
DrDrakken  is currently offline 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
icon5.gif  Re: sfYzAjaxValidationPlugin Support Page [message #37467 is a reply to message #37344 ] Mon, 15 October 2007 19:15 Go to previous messageGo to next message
enigma
Messages: 94
Registered: March 2007
Location: Poland
Member
Hi Smile thakns for plugin, It's great and useful Smile yesterdday I spend over hours to make own action to validate ajax form Razz

But I have one question

I have login form
If user pass wrong data this plugin shows errors and this is ok
but when user pass corect login and password should be redirect to another page. in executeLogin action I have redirect line, but it doesn't work. How to make redirection for this plugin ?


Paweł Ryznar - programista JAVA :: Love IT - devBlog
Re: sfYzAjaxValidationPlugin Support Page [message #37472 is a reply to message #37467 ] Mon, 15 October 2007 20:46 Go to previous messageGo to next message
DrDrakken  is currently offline DrDrakken
Messages: 80
Registered: January 2007
Member
Hey Enigma,
I'm really glad to hear the plugin is useful to you! I am having a few midterms these couple of weeks so I won't be able to look into the problem until after all my testing is done, but maybe something you could try is to change the redirect to a forward. Please feel free to look into the code and make your own changes and updates!
Thanks,
Dr. Drakken

Re: sfYzAjaxValidationPlugin Support Page [message #37473 is a reply to message #37344 ] Mon, 15 October 2007 21:09 Go to previous messageGo to next message
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 #37544 is a reply to message #37344 ] Tue, 16 October 2007 19:23 Go to previous messageGo to next message
enigma
Messages: 94
Registered: March 2007
Location: Poland
Member
How can I change in this plugin code standard from utf-8 to iso-8859-2 ?


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 Go to previous messageGo to next message
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
yzValidatorHelper::
form works correctly


Paweł Ryznar - programista JAVA :: Love IT - devBlog
Re: sfYzAjaxValidationPlugin Support Page [message #37835 is a reply to message #37789 ] Mon, 22 October 2007 02:41 Go to previous messageGo to next message
DrDrakken  is currently offline DrDrakken
Messages: 80
Registered: January 2007
Member
Since Symfony 1.1 will have a new validation subframework, I think it would be wise to wait until the release and see what to do then.
Re: sfYzAjaxValidationPlugin Support Page [message #39111 is a reply to message #37835 ] Thu, 08 November 2007 23:22 Go to previous messageGo to next message
postman  is currently offline 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 #44846 is a reply to message #39111 ] Tue, 05 February 2008 14:44 Go to previous messageGo to next message
pomidor  is currently offline pomidor
Messages: 27
Registered: November 2007
Location: Ukraine, Dnipropetrovsk
Junior Member
I implemented the plugin - very nice one, but i have a problem with Cyrillic encoding
i receive messages that looks like that: ↓ Укажите email ↓
can you help, please?
Re: sfYzAjaxValidationPlugin Support Page [message #45627 is a reply to message #37344 ] Sat, 16 February 2008 11:32 Go to previous messageGo to next message
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 #46350 is a reply to message #45627 ] Tue, 26 February 2008 02:23 Go to previous messageGo to next message
madimayzel  is currently offline madimayzel
Messages: 3
Registered: February 2008
Location: Phillipines
Junior Member
thanks for the plugin it's really helpful
Re: sfYzAjaxValidationPlugin Support Page [message #49255 is a reply to message #45627 ] Sat, 05 April 2008 15:34 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
I've got the same problem as you enigma... How did you solve it?
Or is there anybody else with the same problem who has a solution?

Thanks in advance!
Re: sfYzAjaxValidationPlugin Support Page [message #49277 is a reply to message #49255 ] Sun, 06 April 2008 01:18 Go to previous messageGo to next message
djoos  is currently offline 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 Go to previous messageGo to next message
joethong  is currently offline 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 #49723 is a reply to message #49319 ] Fri, 11 April 2008 12:30 Go to previous messageGo to next message
pomidor  is currently offline pomidor
Messages: 27
Registered: November 2007
Location: Ukraine, Dnipropetrovsk
Junior Member
Plugin is very usfull, big thanks to the Author.

I have a question to masters of this plugin:
I want to validate form, but action of this is under sucure restrictions, and when i send data i recive response with the content of page to which user must be redirected if he isn't authenticated or doesn't have right credentials.

What is the problem?
Re: sfYzAjaxValidationPlugin Support Page [message #50264 is a reply to message #39111 ] Fri, 18 April 2008 12:06 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi,
I have the same trouble with this plugin
after a click on submit i'm redirected to a yzValidation module with a blank page.
How did you solve this problem?

Thanks d'avance Confused

Patrov
Re: sfYzAjaxValidationPlugin Support Page [message #50266 is a reply to message #50264 ] Fri, 18 April 2008 12:28 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
Hi Patrov,

could you post some code? Then we can have a look at it!
Re: sfYzAjaxValidationPlugin Support Page [message #50277 is a reply to message #50266 ] Fri, 18 April 2008 14:06 Go to previous messageGo to next message
patrov  is currently offline 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
myapp/yzAjaxValidation


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.
Re: sfYzAjaxValidationPlugin Support Page [message #50302 is a reply to message #50277 ] Fri, 18 April 2008 16:32 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

a
'
was missing Rolling Eyes
Re: sfYzAjaxValidationPlugin Support Page [message #50307 is a reply to message #50302 ] Fri, 18 April 2008 16:50 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
...so the issue is solved?
Re: sfYzAjaxValidationPlugin Support Page [message #50456 is a reply to message #50307 ] Mon, 21 April 2008 10:56 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi thanks for the help,

Unfortunately I still have a error.

  <h1>[sfControllerException]</h1>

  <h2 id="message">{sfController} controller "/" does not exist in: %SF_ROOT_DIR%/apps/myapp/modules

//actions, %SF_ROOT_DIR%/config/../data/symfony/modules//actions</h2>

    <h2>stack trace</h2>...


I've made some tests the page can reach yzValidation.js.

I don't know why it can't see my action.

Thanks again.
Patrov
Re: sfYzAjaxValidationPlugin Support Page [message #50468 is a reply to message #50456 ] Mon, 21 April 2008 11:49 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
Could you try to add hidden fields to your form? I had to do that in order to correctly specify the module and action as well, it might help you too...

<?php echo input_hidden_tag('yzValidator_destination_module','myModule'); ?>
<?php echo input_hidden_tag('yzValidator_destination_action','myAction'); ?>
Re: sfYzAjaxValidationPlugin Support Page [message #50489 is a reply to message #50468 ] Mon, 21 April 2008 14:07 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi again,
can't it be the yzValidation.js file?
I have tried the hidden_tag but nothing change.

I'm hopeless Confused

thanks for the help.
Patrov.
Re: sfYzAjaxValidationPlugin Support Page [message #50490 is a reply to message #50489 ] Mon, 21 April 2008 14:14 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
Did you change anything in there as well? Since the one that comes with the plugin works fine...
Re: sfYzAjaxValidationPlugin Support Page [message #50492 is a reply to message #50490 ] Mon, 21 April 2008 14:36 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi,
I have the original .js file
but i was thinking about where i have to put it.

I have tried to use an echo javascript_tag() with the content of the yzValidation.js but it still doesn't work even if i can see my error messages in the X-JSON response.
Re: sfYzAjaxValidationPlugin Support Page [message #50503 is a reply to message #50492 ] Mon, 21 April 2008 15:38 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
Could you double check whether you have created a "sfYzAjaxValidationPlugin"-folder in the web folder of your project? In that sfYzAjaxValidationPlugin-folder, just copy the plugins js-folder.

So: YOUR PROJECT\web\sfYzAjaxValidationPlugin\js, and in there the yzAjaxValidation.js needs to be located...
Re: sfYzAjaxValidationPlugin Support Page [message #50507 is a reply to message #50503 ] Mon, 21 April 2008 15:55 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi again,

For the js location everything looks correct. Indeed i have made a test with an alert message placed inside the YzValidation.js file.
However the json object is null when i make an alert(json);
and an alert(json.lengh) doesn't 'alert' anything.
Could it be an prototype problem?
Re: sfYzAjaxValidationPlugin Support Page [message #50559 is a reply to message #50507 ] Tue, 22 April 2008 09:29 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi Again,

I'm using the 1.0.9 Symfony version. Any wellknown bug about Json with this version?
in fact my json object in the callbalk is allways null.
Re: sfYzAjaxValidationPlugin Support Page [message #50570 is a reply to message #37344 ] Tue, 22 April 2008 11:45 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi,

Thanks for this plugin.
I'm trying to use it on a symfony poject based on the 1.0.9 version but the Json object on the callback is allways 'null' even if i can see my error messages on the X-Json header.
Any idea?

Thanks again.
Re: sfYzAjaxValidationPlugin Support Page [message #50574 is a reply to message #50570 ] Tue, 22 April 2008 11:55 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
Could you try to make just a simple form with the yzValidation, without making use of JSON? I'm not too familiar with JSON but in order to locate the core of the issue, I'd suggest to keep it simple and see how that works out, ok?

Make sure to include the hidden fields with the yzValidation-module and action in it as well (since the default way doesn't seem to work for me either Wink )...
Re: sfYzAjaxValidationPlugin Support Page [message #50587 is a reply to message #50574 ] Tue, 22 April 2008 14:03 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

FIX Laughing Cool

Indeed it was something about json and symfony !

In my error message i have used a simple quote.

names:
  nom:
    required:       Yes
    required_msg:   Le champ 'Nom' est obligatoire.
    validators:     [nameValidator, regexnameValidator]


Json doesn't seem to support the simple quote.
I have changed 'Nom' by "Nom". That's it!

Thanks again for your help.
Re: sfYzAjaxValidationPlugin Support Page [message #50599 is a reply to message #50587 ] Tue, 22 April 2008 15:07 Go to previous messageGo to next message
djoos  is currently offline djoos
Messages: 290
Registered: August 2007
Location: London
Faithful Member
You're welcome!
Re: sfYzAjaxValidationPlugin Support Page [message #51742 is a reply to message #37344 ] Sat, 10 May 2008 07:35 Go to previous messageGo to next message
need_help  is currently offline need_help
Messages: 30
Registered: August 2007
Location: Indonesia
Member
Can somebody give me an example to add yz indicator in form_tag()? Thank You and sorry about my english because i'm indonesian.
Re: sfYzAjaxValidationPlugin Support Page [message #58139 is a reply to message #37344 ] Thu, 07 August 2008 02:24 Go to previous messageGo to next message
bigm  is currently offline bigm
Messages: 40
Registered: April 2008
Location: Australia
Member
Hi,

Does this plugin still exist?

The link in the first post now redirects to the new plugins site ( http://www.symfony-project.org/plugins/sfYzAjaxValidationPlu gin) where it says "The plugin sfYzAjaxValidationPlugin does not exist."

Thanks,
JM


Regards,
JM
http://www.symfonynerds.com
Re: sfYzAjaxValidationPlugin Support Page [message #68437 is a reply to message #58139 ] Tue, 23 December 2008 02:30 Go to previous messageGo to next message
exien  is currently offline exien
Messages: 22
Registered: July 2007
Junior Member
Somebody deleted it from the symfony plugins site, but I downloaded it before it was deleted. Here you go:

http://markdeepwell.com/dl/sfYzAjaxValidationPlugin.zip

It's a bit tricky to setup, but works well.
Re: sfYzAjaxValidationPlugin Support Page [message #68438 is a reply to message #68437 ] Tue, 23 December 2008 04:13 Go to previous message
bigm  is currently offline bigm
Messages: 40
Registered: April 2008
Location: Australia
Member
Thanks exien!!! Smile


Regards,
JM
http://www.symfonynerds.com
Previous Topic:How to create admin-module in plugin?
Next Topic:[sfXSLTViewPlugin] First release
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software