wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Disable Paragraph Tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disable Paragraph Tag?" Watch "Disable Paragraph Tag?" New topic
Author

Disable Paragraph Tag?

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi All,

My question is somewhat related to my post in the jsp forum.
I asked this question since this is related to HTML.
Is there a way in javascript or jquery that will allow me to disable access to certain paragraph tag?
I basically want to disable the paragraph tag so that user wont be able to alter/change the select tag
since I mostly populate this with option values coming from ajax call.



I can't set the disabled attribute to the select tag since it wont get submitted into the server so I am thinking
of just disabling the paragraph that serves as parent of the select tag.

Is this possible or can you suggest another alternative into my way of thinking?

Thanks!


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

Not possible. Only form elements have the disabled attribute.

Is the dropdown only conditionally disabled? If not, why have a dropdown at all that cannot be used?

Otherwise, you could re-enable the dropdown just before submitting (I think you mentioned this elsewhere), or you could create a hidden input that provides the value to be submitted.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi Bear,

Is the dropdown only conditionally disabled? If not, why have a dropdown at all that cannot be used?


I actually bind the values in my dropdown with a form bean in my Spring MVC Command bean. They are always disabled and are shown only and gets populated based
on certain choices by the user and by the returns of my ajax call to the server

you could re-enable the dropdown just before submitting (I think you mentioned this elsewhere)


Haven't thought of this yet. With these, I created this code and hijack the form submission



Everything gets submitted and is binded correctly on the command bean. Thanks thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

I still don't quite get why the drop down is there at all if it's never enabled, but glad that it's working for you..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable Paragraph Tag?
 
Similar Threads
How to delete nodes without any content
Struts 2 Form element disabled not working
html:text how to set id attribute
Disabling html:select by form bean property
Not submitting forms with disabled attribute