<div dir="ltr"><div><div>replacing the first few lines with:<br><br><html><br><body><br><br><h1>Get in the game.</h1><br><br><form action="user" method="POST"><br>First name:<br><br><br></div>I still get Error 404<br><br></div>Interestingly enough when I modify this <a href="http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_submit">http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_submit</a> to method="POST" it does not work either. <br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-07 10:54 GMT-05:00 John Stoffel <span dir="ltr"><<a href="mailto:john@stoffel.org" target="_blank">john@stoffel.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
And I know there's a helper you can use to fill in the action so that<br>
you don't have to update the URLs when you deploy it elsewhere.... but<br>
I'm at work and not near my notes...<br>
<br>
Ah... here it is. Just do:<br>
<br>
<form action="user"><br>
<br>
And I think you also want to remove the <!DOCTYPE html> as well, since<br>
this template will get embedded into alayout which will take care of<br>
all that stuff.<br>
<br>
John<br>
<br>
<br>
Andrew> I think what you're after is something like this to tell the browser you want to POST:<br>
Andrew> <form action="<a href="http://localhost:3000/user" rel="noreferrer" target="_blank">http://localhost:3000/user</a>" method="POST"><br>
<br>
Andrew> Does that do the trick?<br>
<br>
Andrew> A<br>
<br>
Andrew> On Fri, Aug 7, 2015 at 3:47 PM, Richard Reina <<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>> wrote:<br>
<br>
Andrew> Wait, Does this provide a clue to the error of my ways? This is the template (<a href="http://user.tt" rel="noreferrer" target="_blank">user.tt</a>) that I<br>
Andrew> am using for the form.<br>
<br>
Andrew> <!DOCTYPE html><br>
Andrew> <html><br>
Andrew> <body><br>
<br>
Andrew> <h1>Get in the game.</h1><br>
<br>
Andrew> <form><br>
Andrew> First name:<br><br>
Andrew> <input type="text" name="firstname"><br>
Andrew> <br><br>
Andrew> Last name:<br><br>
Andrew> <input type="text" name="lastname"><br>
Andrew> <br><br>
Andrew> Email Address:<br><br>
Andrew> <input type="text" name="email"><br>
Andrew> <br><br>
Andrew> User Password:<br><br>
Andrew> <input type="password" name="psw"><br>
Andrew> <br><br>
Andrew> User Confirm Password:<br><br>
Andrew> <input type="password" name="psw2"><br>
Andrew> <br><br>
Andrew> Terms & Conditions<br>
Andrew> <input type="checkbox" name="terms"> I agree with terms and conditions.<br><br>
Andrew> <br><br>
Andrew> <input type="submit" value="Go" /><br>
Andrew> </form><br>
<br>
Andrew> <p>Note that the form itself is not visible.</p><br>
<br>
Andrew> <p>Also note that the default width of a text field is 20 characters.</p><br>
<br>
Andrew> </body><br>
Andrew> </html><br>
<br>
Andrew> 2015-08-07 9:36 GMT-05:00 John Stoffel <<a href="mailto:john@stoffel.org">john@stoffel.org</a>>:<br>
<br>
Andrew> You need to build a web page with a FORM first, then submit the data<br>
Andrew> that way to the /user URL, so it can get handled.<br>
<br>
Andrew> Try using git to clone this repository and use that as a base for your<br>
Andrew> playing around:<br>
<br>
Andrew> <a href="https://github.com/agordon/dancer_bootstrap_fontawesome_template.git" rel="noreferrer" target="_blank">https://github.com/agordon/dancer_bootstrap_fontawesome_template.git</a><br>
<br>
Andrew> I don't have any working examples handy right this second...<br>
<div><div class="h5"><br>
Richard> I am hoping someone can help me understand how to get this to<br>
Richard> work as a POST instead of GET. When I do sub below as 'get'<br>
Richard> it works but when I replace 'get' with 'post' I get:<br>
<br>
Richard> --2015-08-06 13:52:05-- <a href="http://0.0.0.0:3000/user" rel="noreferrer" target="_blank">http://0.0.0.0:3000/user</a><br>
Richard> Connecting to 0.0.0.0:3000... connected.<br>
Richard> HTTP request sent, awaiting response... 404 Not Found<br>
Richard> 2015-08-06 13:52:05 ERROR 404: Not Found.<br>
<br>
Richard> package MyApp;<br>
Richard> use Dancer ':syntax';<br>
Richard> use Dancer::Plugin::FormValidator;<br>
<br>
Richard> our $VERSION = '0.1';<br>
<br>
Richard> post '/user' => sub {<br>
<br>
Richard> my $input_hash = {<br>
<br>
Richard> FName => param('firstname'),<br>
Richard> LName => param('lastname'),<br>
Richard> Email => param('email'),<br>
Richard> Terms => param('terms'),<br>
<br>
Richard> };<br>
<br>
Richard> my $number_of_defined_values = scalar grep { defined } values %{$input_hash};<br>
Richard> $number_of_defined_values = $number_of_defined_values + 0;<br>
<br>
Richard> if ($number_of_defined_values > 1) {<br>
<br>
Richard> my $error = form_validator_error( 'profile_user', $input_hash );<br>
<br>
Richard> if ( ! $error ) {<br>
Richard> #the user provided complete and validates data it's cool to proceed<br>
<br>
Richard> } else {<br>
<br>
Richard> my %hash = %$error;<br>
Richard> foreach my $k (keys %hash) {<br>
Richard> return "$k: $hash{$k}\n";<br>
<br>
Richard> }<br>
<br>
Richard> }<br>
Richard> }<br>
<br>
Richard> template 'user';<br>
<br>
Richard> ##########################################################<br>
Richard> }; ### end of sub user ###################################<br>
<br>
Richard> true;<br>
<br>
Richard> Thanks in advance for any help.<br>
<br>
Richard> _______________________________________________<br>
Richard> dancer-users mailing list<br>
Richard> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
Richard> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</div></div>Andrew> _______________________________________________<br>
Andrew> dancer-users mailing list<br>
Andrew> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
Andrew> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br>
Andrew> _______________________________________________<br>
Andrew> dancer-users mailing list<br>
Andrew> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
Andrew> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br>
Andrew> --<br>
Andrew> Andrew Solomon<br>
<br>
Andrew> Mentor@Geekuni <a href="http://geekuni.com/" rel="noreferrer" target="_blank">http://geekuni.com/</a><br>
Andrew> <a href="http://www.linkedin.com/in/asolomon" rel="noreferrer" target="_blank">http://www.linkedin.com/in/asolomon</a><br>
<br>
Andrew> _______________________________________________<br>
Andrew> dancer-users mailing list<br>
Andrew> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
Andrew> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</div></div></blockquote></div><br></div>