----- Original Message ----- 
From: "Mark Rajcok" <[EMAIL PROTECTED]>
To: "Jonathan Mangin" <[EMAIL PROTECTED]>
Sent: Tuesday, November 28, 2006 11:57 AM
Subject: Re: [cgiapp] Returning multiple values with CGI::Ajax


> >   Something I saw on the TT list makes me think there's a conflict with
> >   return ($form2, $form3) and TT, but I'm clueless.
> 
> The return($form2, $form3) is in your Perl script, not a TT template,
> right?  If so, then I don't think it's a TT problem.
> If you do a view-source, do you see the correct javascript? i.e.,
> selected_date(['date'], ['form2_date','form3_date'])
> 
> One other idea: change the javascript to
> selected_date(['date'], ['form3_date','form2_date'])
> and see if form2_date now has 'undefined'.
> If so, that would indicate a problem passing back a second parameter
> (or trying to target a second div).  However, if form2_date looks
> good, then the problem might be with your div for form3_date.
> 
> -- Mark
> 
1.  I swapped the divs and <form2_date> was undefined.

2.  Changed the template: onblur="selected_date(['date'],['form2_date']);"

    Changed the sub:

    sub form2_date {
       my $self = shift;
       my $q = $self->query();
       my $date = $q->param('date');

       my $form2 = "<input type=text name=date value=$date><br>";
       my $form3 = "--<input type=text name=date value=$date>--";

       return ($form2, $form3);
    }

    The only one that showed up was $form3 (with dashes).

I don't know what that means but it was worth trying.

Thanks,
Jon

BTW, sample program pjx_manyret.pl uses a coderef, which I
wasn't sure how to use with CGI::Application.


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to