Webprogr: Link with automatic submit

Bruno Desthuilliers onurb at xiludom.gro
Fri Oct 20 13:18:43 CEST 2006


Gregor Horvath wrote:
> Hi,
> 
> As I am no expert web programmer I thought I'd better ask the experts if
> there is a simpler or better solution to my problem than the one I am
> thinking of. (using TurboGears)
> 
> The problem
> -----------
> 
> I have a form. Ok. you can submit, validate it etc.
> Now I have a link on that form to another page.
> What I want is that the form gets automatically submitted and validated
> before the browser follows the link. If the validation has errors the
> link should not be followed.
> 
> My solution
> -----------
(snip)
> Are there any other options?

<OT>
yes : replace the link with another submit button, then in your
controller check which submit has been successful and take appropriate
action.

Links are for GET request (which are supposed to be idempotent), and are
definitively *not* supposed to issue (even if indirectly) a POST request.
</OT>

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list