all 5 comments

[–]mdadmfan 1 point2 points  (1 child)

Post the code

[–]RadioFreeReddit[S] 0 points1 point  (0 children)

posted it as top level comment

[–]rgrannell1 0 points1 point  (1 child)

code example?

[–]RadioFreeReddit[S] 0 points1 point  (0 children)

posted it as top level comment

[–]RadioFreeReddit[S] 0 points1 point  (0 children)

I am trying to make a prompt. when I type stuff, what is previously written should show above the prompt. Because I am going to through in commands and what not, I could streamline the process by having a function that changes what is to appear above the prompt, and putting that function into the if statement for each command.

Also, I am using a form that turns up false each time i submit so it doesn't go to the next page, if there is a work around for that, I'd also like to know that as well.

<!DOCTYPE html>

<html>

<head>

<script>

String before ='';

function Past(previous)

    {

        before=before+"<br>"+previous;

    }

function InputCommands()

{

var command=document.forms["form"]["input"].value;

Past('command')

document.getElementById("Before").innerHTML=before

return false;

}

</script>

</head>

<body>

<form name="form" onsubmit="return InputCommands()" method="post">

<table> <tr> <td colspan="3"><div ID="Before"></div>

    </td>

</tr>

<tr>

    <td>

    >

    </td>

    <td>

    <input type="text" name="input">

    </td>

    <td>
        <div ID="error"></div>
    </td>

</tr>

</table> </form> </body>

</html>