Created
          June 15, 2011 11:55 
        
      - 
      
 - 
        
Save meehow/1026934 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $.post($(this).attr('action'), form.serialize(), function(answear){ | |
| form.find('.errorlist').remove(); | |
| $.each(answear['errors'], function(key, value){ | |
| var errors = ''; | |
| $.each(value, function(i,v){ | |
| errors += '<li>'+v+'</li>'; | |
| }); | |
| form.find('#id_'+key).before('<ul class="errorlist">'+errors+'</ul>'); | |
| }); | |
| if (answear['id']){ | |
| target = $(form.dialog('option', 'target')); | |
| target.append('<option value="'+answear['id']+'">'+answear['value']+'</option>'); | |
| form.find('input').val(''); | |
| form.dialog('close'); | |
| } | |
| }, 'json'); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment