daveoffy Posted August 22, 2009 Share Posted August 22, 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 without having to hit submit. I just want a preview so the user can see what it looks like. Quote Link to comment Share on other sites More sharing options...
haku Posted August 22, 2009 Share Posted August 22, 2009 Add an onkeyup handler to the input question, and make the function attached to that handler read the value, then insert it into the spot where you want it to display. Quote Link to comment Share on other sites More sharing options...
daveoffy Posted August 22, 2009 Author Share Posted August 22, 2009 Example code would be very helpful please. Never code in JS so no idea how to do this. Quote Link to comment Share on other sites More sharing options...
corbin Posted August 22, 2009 Share Posted August 22, 2009 He basically told you what to do.... Something like: function SomeFunc(i) { document.getElementById('blah').innerHTML = i.value; } <input .... onkeyup="SomeFunc(this);"> <div id="blah"></div> You would of course want to check for errors better than I did there. Quote Link to comment Share on other sites More sharing options...
haku Posted August 22, 2009 Share Posted August 22, 2009 This section is for javascript help - we're happy to help. But it's not the 'write javascipt for other people' forum. That place exists - it's called my job 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.