• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to disable text area

 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a form and when user fill it and click on preview he get preview and
the form go down with filled value. But i have to disable those fields with the help of javascript.
i was try so many ways
like

JSP code
<form name="form">
<input name="listingtitle" id="listingtitle" >
</form>

JavaScript code
<script>
function disable(){
document.form.getElementById('listingtitle').disable = 'true';
or
document.form.listingtitle.disable = 'true';
or
document.form.listingtitle.disable = true;
or
form.listingtitle.disable = true;
or
form.listingtitle.disable = 'true';
}
</script>

Please help for this
Thanks in advance


 
Debasmita Dash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check the following
 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you so much its working
 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but it is not work for drop down combo box
how can i do for combo box

i was try this

var DropDownList1 = document.getElementById('service').value;
DropDownList1.options[0].outerHTML = '<OPTION value=-1 visible="false" >0</OPTION>';

and

var DropDownList1 = document.getElementById('service');
DropDownList1.options[0].outerHTML = '<OPTION value=-1 visible="false" >0</OPTION>';

but its not working
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kavita vala wrote:but it is not work for drop down combo box
how can i do for combo box

There is no such thing as a combo box on the web: read HtmlHasNoComboBox
 
Eswar Nec
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this,


And the JavaScript is :
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic