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. Link to comment https://forums.phpfreaks.com/topic/171364-solved-form-input-preview/ 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. Link to comment https://forums.phpfreaks.com/topic/171364-solved-form-input-preview/#findComment-903740 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. Link to comment https://forums.phpfreaks.com/topic/171364-solved-form-input-preview/#findComment-903747 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. Link to comment https://forums.phpfreaks.com/topic/171364-solved-form-input-preview/#findComment-903751 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 Link to comment https://forums.phpfreaks.com/topic/171364-solved-form-input-preview/#findComment-903792 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.