I'm going crazy but I'm unable to find how can I set an external link
for a form action.
In my Pylons application I created a form that have to be processed
by a credit card security site.
So in <form action="..."> I had put the external link directly. But it
doesn't work. When I click on the submit button, nothing happen.
What does "View Source" show in the browser? The behavior is consistent with <form action="" method="POST" />, which could happen if url_for returned None. That in turn would indicate it couldn't match the route name, and then we'd have to investigate why.
Also, what happens if you replace the h.url_for call with ``url('credit_card')``. url_for is gradually being replaced by pylons.url, which has a different implementation and thus may behave differently.
Another possiblility is that a different route is matching, something earlier in the route definitions.
As a workaround, you can use a 'c' variable for the URL. Routes does not provide much advantage for external URLs, other than the convenience of defining them in the route map.
> What does "View Source" show in the browser? The behavior is
> consistent with <form action="" method="POST" />, which could happen
> if url_for returned None. That in turn would indicate it couldn't
> match the route name, and then we'd have to investigate why.
The page source is ok. The form tag is full filled.
> Also, what happens if you replace the h.url_for call with
> ``url('credit_card')``. url_for is gradually being replaced by
> pylons.url, which has a different implementation and thus may behave
> differently.
I tried without any result.
> Another possiblility is that a different route is matching, something
> earlier in the route definitions.
> As a workaround, you can use a 'c' variable for the URL. Routes does
> not provide much advantage for external URLs, other than the
> convenience of defining them in the route map.
Nothing happen :-((
In all cases I see "waiting for localhost" in the browser and nothing
happen.
On Nov 3, 10:14 am, morellik <enrico.more...@gmail.com> wrote:
> On Nov 2, 8:11 pm, Jonathan Vanasco <jonat...@findmeon.com> wrote:
> > why do you even need to handle the creditcard processing form as a
> > variable ?
> > the chances of that changing should be incredibly slim. i'd just
> > hardcode the form.
> It's the first thing that I tried. Put the address directly into the
> form.
> But nothing works.
I'm very stupid and blind!!!!
I started from another template and tomorrow checking the source of
the page, I had see that there was another form tag
(<form action="">) before the correct tag. So the behaviour of Pylons
was correct.