I use the NicEdit(www.nic edit.com) text-editor on my Text Area which is working and the below code to hide and show text area after selecting a value in the drop down it will show the text area but this is what i need help with:
1) i want the text area to show even before you select any value from the drop down.
2) i want the Text editor(NicEdit) to show on all the text area after selecting a value from the drop down to show the text area.
Js For Text-editor(Nicedit) :
Js to hide and show text area:
Html drop down:
1) i want the text area to show even before you select any value from the drop down.
2) i want the Text editor(NicEdit) to show on all the text area after selecting a value from the drop down to show the text area.
Js For Text-editor(Nicedit) :
Code:
<script type="text/javascript" src="js/nicEdit.js"></script> <script type="text/javascript"> bkLib.onDomLoaded(function() { new nicEditor({maxHeight : 200}).panelInstance('area'); }); </script>
Code:
<script type="text/javascript"> function showHide() { if(document.getElementById("color_dropdown").selectedIndex == 1) { document.getElementById("hidden1").style.display = ""; // This line makes the DIV visible } else { document.getElementById("hidden1").style.display = "none"; // This line hides the DIV } if(document.getElementById("color_dropdown").selectedIndex == 2) { document.getElementById("hidden2").style.display = ""; // This line makes the DIV visible } else { document.getElementById("hidden2").style.display = "none"; // This line hides the DIV } if(document.getElementById("color_dropdown").selectedIndex == 3) { document.getElementById("hidden3").style.display = ""; // This line makes the DIV visible } else { document.getElementById("hidden3").style.display = "none"; // This line hides the DIV } } </script>
Code:
<select name="menu" id="color_dropdown" onchange="showHide()"> <option>Select Meun</option> <option>One</option> <option>Two</option> <option>Three</option> </select> <textarea id="hidden1" name="area" display:none;" id="area">ggggggggggggggggg</textarea> <textarea id="hidden2" name="area" display:none;" id="area">hhhhhhhhhhhhhhhhh</textarea> <textarea id="hidden3" name="area" display:none;" id="area">yyyyyyyyyyyyyyyyy</textarea>
Comment