Help - Search - Members - Calendar
Full Version: HTML Script for Placing Text
HTMLHelp Forums > Web Authoring > General Web Design
Tom G
Hey.... is there basic html script to allow the following?:

In our church app, we can use basic html. What I am trying to do, is have the user type within a "fill in the blank" field, but I want what they typed to also appear way down the page in another paragraph, targeting a specific spot in a sentence in the paragraph down the page. I need to get this done today if it's possible. It's for our Easter service tomorrow. Our pastor just had this idea... hence the urgency!

Thanks for any input!!

Tom
Christian J
Do you want to allow anyone to write on the page, and do you want the result to be saved and stay visible to any visitor? Then you need a server-side script (like PHP), and it's not a quick task.

But if you only want each user to see the result in his own browser, you can do it relatively fast with java script:

CODE
<p>
<input type="text" id="foo" value="" placeholder="Type your text here">
<input type="button" id="bar" value="View changes">
</p>
...
<p>Some text <span id="baz"></span> more text.</p>

<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function(){
    var foo=document.getElementById('foo');
    var bar=document.getElementById('bar');
    var baz=document.getElementById('baz');
    bar.onclick=function()
    {
        baz.textContent=foo.value;
    }
});
</script>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.