Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > ASP, ASP.NET and Coldfusion

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

ASP, ASP.NET and Coldfusion Microsoft's Web Development Language (ASP/ASP.NET) and Coldfusion discussion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-2007, 12:25 PM
reachpradeep's Avatar   
reachpradeep reachpradeep is offline
Learning Programmer
 
Join Date: Mar 2007
Location: India
Posts: 41
Credits: 0
Rep Power: 6
reachpradeep is on a distinguished road
Send a message via MSN to reachpradeep
Default Disable a button

I have a Save button on a web page.
I want to disable the button when clicked, so that the user does not click it more than once, as the serevr side code is being processed.
i disabled the button by calling a javascript function -
btnSave.Attributes.Add("onClick","return buttonDisabled();") ;

In the Javascript file i have -
function disableButton()
{
var btnSave = document.getElementById('btnSave') ;
btnSave.disabled = true ;
return true ;
}

since the button gets disabled my server side code(in C#) does not get executed.
thanks a lot for any kind of help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-03-2007, 02:35 PM
crazyinstinct's Avatar   
crazyinstinct crazyinstinct is offline
Newbie
 
Join Date: Mar 2007
Age: 20
Posts: 7
Credits: 0
Rep Power: 0
crazyinstinct is on a distinguished road
Default

Your button:
<input type = submit id = "btnSave" onclick = "disableButton()">

The Javascript function:
function disableButton() {
var btnSave = document.getElementById('btnSave') ;
btnSave.disabled = true ;
yourformname.submit();
}


I hope this solves your problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows XP Tricks & Tips!!!!..new ones. pranky Tutorials 9 08-23-2008 03:22 PM
Java:Tutorial - Make Your Button Work John Java Tutorials 0 01-11-2007 02:04 PM
The X button dirkfirst C# Programming 3 07-17-2006 09:42 PM
Mac Mouse Button encoder General Programming 8 07-12-2006 03:14 PM
How to Count number of button has been Click? roger Visual Basic Programming 4 06-01-2006 02:49 PM


All times are GMT -5. The time now is 07:32 PM.

Contest Stats

Xav ........ 1322.18
MeTh0Dz|Reb0rn ........ 1053.7
morefood2001 ........ 879.43
John ........ 877.37
marwex89 ........ 869.98
WingedPanther ........ 830.24
Brandon W ........ 733.07
chili5 ........ 309.39
Steve.L ........ 236.23
dcs ........ 212.02

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads