ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 11th, 2005, 04:30 PM
cfgirl cfgirl is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 14 cfgirl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation disable all links after clicking it.. <a href ="blablabla.html" onclick=???

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!

Reply With Quote
  #2  
Old January 11th, 2005, 05:10 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 42 m 54 sec
Reputation Power: 53
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > disable all links after clicking it.. <a href ="blablabla.html" onclick=???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT