Jump to content

[SOLVED] input preview


daveoffy

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/171331-solved-input-preview/
Share on other sites

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/171331-solved-input-preview/#findComment-903552
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.