Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling page via javascript

Status
Not open for further replies.

rpeters74

Programmer
May 24, 2002
46
0
0
US
Not wanting users to double-click buttons or navigate from a page after clicking a Save button I incorporated a javascript. The script loops through the form elements using getElementsByTageName('INPUT') then sets the element's disable property to true. I add an attribute to the Save button's onclick to call this javascript function.

Problem is the server click event is not firing because the javascript runs before the Save buttons Server click event. I have wired the javascript call from the Save button using onmousedown, onmouseup but still get the same behavior. I figure the Save button itself is getting disabled then the server-side event is not firing so I altered the javascript to ignore the button that was clicked (the Save button) ... still get the same results ...

any ideas?
 
Leave the javascript wired up to the onclick event, but have it return true - in order to post back.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top