|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm done building a shoping cart, but when the user views his/her cart they have the option of deleting each item one by one... but if you try to delete an item and before the page refreshes itself you click delete for a different item you get an error. SO I was wondering if there is a onclick=" that disables all links on the page after a link is clicked to avoid this error.
THank you already for your answers! |
|
#2
|
|||
|
|||
|
Even if there is a way to do this, don't. You're going about this the wrong way. The answer isn't to disable all the links until the first request is handled. Instead, you should design your shopping cart logic to handle situations like this.
I tend to pass the item ID or the array element number of the item being deleted. That way if the user clicks one link and then clicks another before the request finishes, the cart just deletes the second product instead of the first one. Or, if the request has gotten far enough through processing that the first item is deleted, then the cart should gracefully handle the problem by throwing an exception, displaying a message, or by not doing anything at all and just displaying the cart as it currently is (regardless of what's been deleted). This will also handle situations where a user mucks around with the form/url variables or uses the back button to try and delete something that isn't even in the cart any more (or never even was). Hope that helps.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > disable all links after clicking it.. <a href ="blablabla.html" onclick=??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|