[cgiapp] What happens after validation?

2006-03-06 Thread Robert Hicks

I have all my forms validating. Yay!

The question I have is what happens after validation?

If I create a small form like this that doesn't use my validation stuff:

Form without validation:


Username:



NAME1
NAME2




 

 








When I get to the "show_task_page" I can do "$q->param('user_name')" and 
get the value from the form.


If I send my page through my validation I no longer can do that. I know 
that because I am passing the value to another page that shows up when I 
do it without validation and doesn't when I validate. I imagine it has 
to do with how I am redirecting out of the validation.


Form with validation:


Username:



NAME1
NAME2





 

 







Validation code:

sub _validate_task_form : Runmode {
my $self = shift;
my $q = $self->query;

my ( $results, $err_page ) = $self->check_rm('show_task_page', {
required => [qw/charge_ids project_names task_name 
task_date total_hours/],

constraints => {
total_hours => qr/^(\d*(\.((00?)|(25)|(50?)|(75))0*)?)$/,
},
msgs => {
any_errors => 'err__',
prefix => 'err_',
},
});

return $err_page if $err_page;

$self->redirect('index.cgi?rm=show_next_page');
}

How do I pass the form elements after it has been validated?

I hope I have given you enough to go by this time. I am trying to get my 
head around C::A and all. I suck at forms and I am trying to remedy that 
too!


Robert


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



Re: [cgiapp] XUL

2006-03-06 Thread Jason Purdy

Bill Stephenson wrote:

I was poking around yesterday and found this:

http://developer.mozilla.org/en/docs/XUL

Very interesting

Has anyone here played around with this at all?
I have - I actually developed my first Firefox extension (been meaning 
to share the word):


https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&id=1881

XUL is pretty neat, but the meat really lies in the underlying 
Javascript to make stuff happen.


Really want to see what XUL can do, check out what one guy did with it & 
Amazon:


http://www.faser.net/mab/chrome/content/mab.xul

- Jason

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



[cgiapp] XUL

2006-03-06 Thread Bill Stephenson

I was poking around yesterday and found this:

http://developer.mozilla.org/en/docs/XUL

Very interesting

Has anyone here played around with this at all?

--
Bill





Kindest Regards,

--
Bill Stephenson
417-546-8390


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



[cgiapp] Re: [Cgi-session-user] Trouble with C::S::SQLite

2006-03-06 Thread Ron Savage
On Mon, 6 Mar 2006 18:28:11 -0600, Puneet Kishor wrote:

Hi Puneet

> [Mon Mar  6 18:23:27 2006] index.cgi: DBD::SQLite::db prepare
> failed: no such table: sessions(1) at dbdimp.c line 269 at

The fact that the table is called sessions(1) and not sessions is the clue to
follow first. Check the SQL used or generated.
--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html



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



Re: [cgiapp] Jemplate form submission

2006-03-06 Thread Cees Hek
On 3/6/06, Bruce McKenzie <[EMAIL PROTECTED]> wrote:
> Thanks, Cees, nope it's running on my localhost Apache server. I
> retrieved the error message from the FireFox Javascript console.

hmm, not sure then...  I would try a google search on the errors and
see what comes up.

Also, if you use IRC, you might try the #jemplate channel on irc.freenode.net

Cheers,

Cees

>
>
>
> Cees Hek wrote:
> > On 3/6/06, Bruce McKenzie <[EMAIL PROTECTED]> wrote:
> >
> >>But textAjax throws this  javascript error:
> >>
> >>Error: [Exception... "Component returned failure code: 0x80040111
> >>(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult:
> >>"0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame ::
> >>http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js :: anonymous
> >>:: line 558"  data: no]
> >>Source File: http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js
> >>Line: 558
> >
> >
> > Are you loading the main HTML file into your browser though a
> > webserver, or by opening the file directly?  I have seen similar
> > errors when I was loading the main HTML file using a file:// URI
> > instead of an http:// URI.
> >
> > Cheers,
> >
> > Cees
> >
> > -
> > Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
> >   http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
> --
> Bruce McKenzie
> Business Information Graphics, Inc.
> 242 W. 36th Street
> 10th Floor
> New York, NY 10018
>
> v. 212-477-4288
> http://www.2MinuteExplainer.com
>

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



Re: [cgiapp] Jemplate form submission

2006-03-06 Thread Bruce McKenzie
Thanks, Cees, nope it's running on my localhost Apache server. I 
retrieved the error message from the FireFox Javascript console.




Cees Hek wrote:

On 3/6/06, Bruce McKenzie <[EMAIL PROTECTED]> wrote:


But textAjax throws this  javascript error:

Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame ::
http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js :: anonymous
:: line 558"  data: no]
Source File: http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js
Line: 558



Are you loading the main HTML file into your browser though a
webserver, or by opening the file directly?  I have seen similar
errors when I was loading the main HTML file using a file:// URI
instead of an http:// URI.

Cheers,

Cees

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






--
Bruce McKenzie
Business Information Graphics, Inc.
242 W. 36th Street
10th Floor
New York, NY 10018

v. 212-477-4288
http://www.2MinuteExplainer.com

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



Re: [cgiapp] Jemplate form submission

2006-03-06 Thread Cees Hek
On 3/6/06, Bruce McKenzie <[EMAIL PROTECTED]> wrote:
> But textAjax throws this  javascript error:
>
> Error: [Exception... "Component returned failure code: 0x80040111
> (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult:
> "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame ::
> http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js :: anonymous
> :: line 558"  data: no]
> Source File: http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js
> Line: 558

Are you loading the main HTML file into your browser though a
webserver, or by opening the file directly?  I have seen similar
errors when I was loading the main HTML file using a file:// URI
instead of an http:// URI.

Cheers,

Cees

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



[cgiapp] Jemplate form submission

2006-03-06 Thread Bruce McKenzie
I've been converting some apps called by CGI::Application::Dispatch to 
run in an Ajax-y way. I've been going along ok with CGI::Ajax, but I was 
intrigued by the Jemplate module for Javascript Templating with Template 
Toolkit, which I first saw mentioned in this list 
(http://search.cpan.org/~ingy/Jemplate-0.17/lib/Jemplate.pm/


The templating part of this works very well. However, the latest release 
(2/28/06) includes Ajax support, so I thought I should try that. Arrgh, 
there are only two methods, and I can't get either to work :-(


Ajax.get is supposed to work like this:

  Ajax.get(url, [callback]);

in my test page there is this JS:

   function handleRequest(){
 alert(arguments[0]);
   }

   function testAjax(){
  Ajax.get('admin.pl/clients/testAjax', handleRequest);
}


in Clients.pm I have runmode testAjax:

sub testAjax{
   my $self=shift;
   use JSON;
   return objToJson( { myKey => "myValue" } );
   }

But textAjax throws this  javascript error:

Error: [Exception... "Component returned failure code: 0x80040111 
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult: 
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: 
http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js :: anonymous 
:: line 558"  data: no]

Source File: http://localhost/public_html/cgi-bin/admin/jemp/Jemplate.js
Line: 558

I didn't have any better luck with the other method,

   Ajax.post(url, data, [callback]);

because I couldn't come up with a format for "data" that worked (tried 
things like document.forms[0], js objs, stringified objs, etc.


I'm sure this is pretty elementary stuff (and not really 
CGI::Application related -- sorry). I'm hoping someone here can point me 
in the right direction


Thx,

Bruce


--
Bruce McKenzie
http://www.2MinuteExplainer.com

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