Jump to content

Looking to create submission form that displays raw output

Frankenburger

So I'm trying to wrap my head around a template generator that displays raw text with pre-formatted entries, but I'm having difficulty coming up with a solution. It can either be for open office, javascript, HTML, or whatever

 

It would look something like this


 

(Text Entry Field) Enter Title Here

(Text Entry Field) [Previous] Enter URL Here

(Text Entry Field) Enter Details Here


(Raw Text Output)

Title

[url=URL From 2nd Entry Field]Previous[/url]

Details

I managed to find a working example, but it only works with one text entry field

 

<!DOCTYPE html>
<html>
<head>
    <title>HTML JavaScript output on same page</title>
    <script type="text/JavaScript">
        function showMessage(){
            var message = document.getElementById("message").value;
            display_message.innerHTML= message;
        }
    </script>
</head>
<body>
Enter message: <input type="text" id = "message">
<input type="submit" onclick="showMessage()" value="submit" />
<p> Message is! <span id = "display_message"></span> </p>
</body>
</html>

Any ideas?

 

Gaming Rig
Spoiler

CPU: Intel i7-6850k @ 4.2GHz

GPU: 2x FE GTX 1080Ti

Memory: 16GB PNY Anarchy DDR4 3200MHz

Motherboard: ASRock X99 Extreme 4

 

Encoding Rig
Spoiler

CPU: Ryzen 7 1700 @ 3.7GHz

GPU: GTX 1050

Memory: 8GB Curcial Ballistix DDR4 2133MHz

Motherboard: Gigabyte AB350M-DS3H

 

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, Frankenburger said:

display_message.innerHTML= message;

 

document.getElementById("display_message").innerHTML = message;

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, WereCatf said:

 


document.getElementById("display_message").innerHTML = message;

I don't really understand the context of this. How would I apply this and how would it help?

 

Gaming Rig
Spoiler

CPU: Intel i7-6850k @ 4.2GHz

GPU: 2x FE GTX 1080Ti

Memory: 16GB PNY Anarchy DDR4 3200MHz

Motherboard: ASRock X99 Extreme 4

 

Encoding Rig
Spoiler

CPU: Ryzen 7 1700 @ 3.7GHz

GPU: GTX 1050

Memory: 8GB Curcial Ballistix DDR4 2133MHz

Motherboard: Gigabyte AB350M-DS3H

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, Frankenburger said:

I don't really understand the context of this. How would I apply this and how would it help?

The example you found doesn't actually work:

function showMessage(){
	var message = document.getElementById("message").value;
	display_message.innerHTML= message; // This doesn't work
}

display_message makes no sense here as-is, because it wasn't declared or defined anywhere else. What was posted was how to actually set the element you want to modify.

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, Mira Yurizaki said:

The example you found doesn't actually work:


function showMessage(){
	var message = document.getElementById("message").value;
	display_message.innerHTML= message; // This doesn't work
}

display_message makes no sense here as-is, because it wasn't declared or defined anywhere else. What was posted was how to actually set the element you want to modify.

So how would I apply that when trying to create a template generator with fill in the blanks that produces raw text? That's the part I'm lost on.

 

Like, using the original example, it works in theory for just one field, but not multiple fields. Also, it doesn't have to be HTML, though HTML would definitely be more convenient than using open office (which is in a lot of ways easier for me to wrap my head around).

 

Gaming Rig
Spoiler

CPU: Intel i7-6850k @ 4.2GHz

GPU: 2x FE GTX 1080Ti

Memory: 16GB PNY Anarchy DDR4 3200MHz

Motherboard: ASRock X99 Extreme 4

 

Encoding Rig
Spoiler

CPU: Ryzen 7 1700 @ 3.7GHz

GPU: GTX 1050

Memory: 8GB Curcial Ballistix DDR4 2133MHz

Motherboard: Gigabyte AB350M-DS3H

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Frankenburger said:

So how would I apply that when trying to create a template generator with fill in the blanks that produces raw text? That's the part I'm lost on.

 

Like, using the original example, it works in theory for just one field, but not multiple fields. Also, it doesn't have to be HTML, though HTML would definitely be more convenient than using open office (which is in a lot of ways easier for me to wrap my head around).

What exactly are you trying to do? A generic template generator is fine and all, but we have to know what you're trying to do this on because everything is going to be different.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×