aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to disable text area Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to disable text area" Watch "how to disable text area" New topic
Author

how to disable text area

kavita vala
Ranch Hand

Joined: Jul 22, 2010
Posts: 42
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

Joined: Apr 07, 2009
Posts: 19
Please check the following
kavita vala
Ranch Hand

Joined: Jul 22, 2010
Posts: 42
thank you so much its working
kavita vala
Ranch Hand

Joined: Jul 22, 2010
Posts: 42
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

Joined: Jan 10, 2002
Posts: 61658
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eswar Nec
Ranch Hand

Joined: May 02, 2010
Posts: 105
Try this,


And the JavaScript is :


Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar
 
Consider Paul's rocket mass heater.
 
subject: how to disable text area