daveoffy Posted August 21, 2009 Share Posted August 21, 2009 So I have a submit form, and I want it, so after filling in each form(or while filling it in) it shows a preview on the side. How can I make it so, when I enter Hi, in a form named title, it shows up somewhere else on that page? Thanks in advance. If this is not possible in PHP please tell me. I think it might be javascript. Quote Link to comment https://forums.phpfreaks.com/topic/171331-solved-input-preview/ Share on other sites More sharing options...
ignace Posted August 21, 2009 Share Posted August 21, 2009 Yep it's javascript. <div id="preview"></div> <textarea rows="5" cols="50" onchange="updatePreview(this)"></textarea> <script type="text/javascript"> <!-- function updatePreview(e) { var id = document.getElementById("preview"); id.setNodeValue(e.getNodeValue()); } //--> </script> I'm no JavaScript expert so the code may be a bit off. I used the DOM API but I'm not sure in how far browsers actually support this. Quote Link to comment https://forums.phpfreaks.com/topic/171331-solved-input-preview/#findComment-903552 Share on other sites More sharing options...
daveoffy Posted August 22, 2009 Author Share Posted August 22, 2009 Not working. I am going to head over to javascript forums, since that is the correct code. Quote Link to comment https://forums.phpfreaks.com/topic/171331-solved-input-preview/#findComment-903733 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.