• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to enable a textarea in javascript?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi! i have a textarea that is currently disabled. using javascript how can enable it on button click?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
onclick="document.formname.elementName.disabled=false;"

Eric
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"j son",
Please check you private messages.
 
jason pogi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i tried the code but it doesnt seem to work, there is an "error on page" showing in the status bar below the browser and nothing happens with the textarea

textarea and button inside form1

thanks in advance
 
jason pogi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i hope you understand the code, i removed all "<" and "/>" and renamed onclick to nclick because i am having trouble in posting the code
 
jason pogi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"j son"

Ben asked you to check your private messages.
 
jason pogi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David O'Meara:
"j son"

Ben asked you to check your private messages.



yes, i just updated my profile
please help me with my code
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you click on that icon in the status bar it brings up a dialog window. What is the error message?



In the future replace the o in onsubmit and onclick with &#111;

Eric
[ August 14, 2007: Message edited by: Eric Pascarello ]
 
jason pogi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eric Pascarello:
When you click on that icon in the status bar it brings up a dialog window. What is the error message?



In the future replace the o in onsubmit and onclick with &#111;

Eric



i tried the code.. there is no error on the page but the textarea is still disabled

<html>
<body
><form id="form1" method="post" action="">
<textarea name="textarea" cols ="60" rows="10" disabled="disabled" id="textarea"> IT Project-1 students please check LMS for prelim requirement.</textarea>
<input name="edit" type="button" id="label2" onclick="document.getElementById("textarea").disabled = false; return false;" value="Edit">
</form>
</body>
</html>
[ August 14, 2007: Message edited by: jason pogi ]
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is code that works:




Eric
[ August 14, 2007: Message edited by: Eric Pascarello ]
 
jason pogi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it worked.. my error is in document.getElementById("ta1").disabled the paramater should be in single quote 'ta1' .
thanks for helping!
 
He does not suffer fools gladly. But this tiny ad does:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic