disable textbox on a click or event

Results 1 to 2 of 2

Thread: disable textbox on a click or event

  1. #1
    Join Date
    Dec 1969

    Default disable textbox on a click or event

    Textbox or submit button should be disabled on aclick or on a event or on apage load

  2. #2
    Join Date
    Dec 1969

    Default That's a JavaScript function and...

    ...not ASP. To disable any input element, you set it&#039;s "disabled" property to true:<BR><BR>document.getElementById("MyElement"). disabled = true;<BR><BR>To have something done on a click or a page load, you put the function call or statements into the relevant event handlers. If you want the browser&#039;s event handler to continue after you have called your function, you return false (or don&#039;t return anything), but if you don&#039;t want the browser to continue, i.e. you don&#039;t want the click to go anywhere, you return true:<BR><BR>&#060;a href="mypage.asp" onClick="callMyFunction(); return true;"&#062;Don&#039;t do anything when you click this except call my function.&#060;/a&#062;<BR><BR>&#060;body onLoad="callMyFunction();"&#062;<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts