Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable Paragraph Tag?

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic