aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Using jQuery to Disable Text Box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Using jQuery to Disable Text Box" Watch "Using jQuery to Disable Text Box" New topic
Author

Using jQuery to Disable Text Box

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
I am using the following function to attempt to disable input but it is not working:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

"not working" isn't helpful. Please read ItDoesntWorkIsUseless.

Try .attr() instead of .prop().


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Keith Wood
Author
Ranch Hand

Joined: Aug 28, 2012
Posts: 38

prop is the correct function to call. However, I suspect that the field you are trying to disable is part of the new content that comes from the load call. If that is the case, then you must only try to access it in the completed callback from the load.



Author of the upcoming "Extending jQuery" book from Manning.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

Ah yes, if that's the case then the element won't yet exist when the statement is executed. Though I'd use the success callback rather than the complete callback (which is also called in the event of an error).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using jQuery to Disable Text Box