blufish Posted August 7, 2008 Share Posted August 7, 2008 Okay, I think this will be a little hard but the problem is I don't know where to start, what I want is a div which people can click on and the little flashing | comes and they can write code and whatever else they wish to write into it. It doesn't HAVE to be a div it could be a textarea if that would work. example: www.googlepages.com When you edit your pages it's like a wysiwyg Thanks all! Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 7, 2008 Share Posted August 7, 2008 Do you mean like this? <div CONTENTEDITABLE="true" STYLE="border:2px inset white;width:150px"></div> Quote Link to comment Share on other sites More sharing options...
blufish Posted August 8, 2008 Author Share Posted August 8, 2008 That looks good! I never knew it was so simple! but how do you make it execute the code you type? Quote Link to comment Share on other sites More sharing options...
xtopolis Posted August 8, 2008 Share Posted August 8, 2008 I think you may have been looking for the inline editing concept. Which can be found here: http://24ways.org/2005/edit-in-place-with-ajax And may answer your "how do I make it execute" question... maybe. Quote Link to comment Share on other sites More sharing options...
blufish Posted August 8, 2008 Author Share Posted August 8, 2008 The example he had didn't execute the code which is what I need. I have this if anyone is willing to help me understand why it isn't working. <html> <head> <title>Edit your page!</title> <script type="text/javascript"> function change() { document.contents.contenteditable="false"; } </script> </head> <body> <input type="button" onclick="change()" value="Change"> <div name=contents CONTENTEDITABLE="true" STYLE="border: 5px dashed black; width:90%; height: 90%;"></div> </body> </html> It should take away the contenteditable thing but it doesn't. Quote Link to comment Share on other sites More sharing options...
blufish Posted August 8, 2008 Author Share Posted August 8, 2008 I have this code which outputs what I write into a div below which will work, but my problem is that in flock and safari it executes the HTML code, but in IE it does not. any ideas? <html> <head> <script type="text/javascript"> function sendtoDiv(){ document.getElementById("divbox").innerHTML = document.getElementById("textarea").value; } </script> </head> <body> <textarea id="textarea" onkeyup="sendtoDiv()"></textarea> <div id="divbox"></div> </body> </html> Quote Link to comment Share on other sites More sharing options...
blufish Posted August 8, 2008 Author Share Posted August 8, 2008 Nevermind got it working don't know how though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.