• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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!
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic