On Wed, Jan 21, 2009 at 10:22 AM, Simon Wilcox
<[email protected]>wrote:

> Dave Howorth wrote:
>
>> Paul Falbe wrote:
>>
>>> That works thank you very much.  Don't know how many google searchs I did
>>> trying to find that out!
>>>
>>
>>  Rodrigo-51 wrote:
>>>
>>>> Paul, how about a javascript confirm() box?
>>>>
>>>
>> ... and if the user has Javascript disabled? ????
>>
>
> Or if you have some like Google's ill-fated prefetch running, caching all
> the links it finds on a page ?
>
> GETing a link should really only be used when the action is idempotent. If
> it changes stuff then you ought to use a POST via a form button.
>
>
 YES!  There are rare cases where a get may enable consequences,  but this
is not one of them.

<form method="POST" action="/yourapp/account/do_delete">
<input type="hidden" name="accountid" value="23948234">
<input type="submit" name="delete"
 value="Delete My Account"
 onClick="return confirm(
  'Are you sure you want to delete your account?');">
</form>


This both checks if the user really wants to delete (if js is enabled) and
also uses a post to delete data via the app.

-- 
Thanks!

Wade Stuart

Phone:  917-363-6164
IM: SpaceMuscles
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to