I'm trying to make a simple calculator and whenever I want to add text to the textfield(say a number) it will show up, then will dissapear.

function display(number)
				var x = document.form1.displayText;
				x.value = number;

This is how I'm doing it, but why is the text dissapearing right after it appears?
Note: This method is called whenever one of the number buttons is clicked.

It's impossible to tell with only the code you showed. Nothing in those two lines would cause the text to disappear.

I know, that's what I don't understand. It' almost like it's refreshing the page or something. Here's the code I've got. I know the thing looks really ugly but I'm a beginner at JavaScript:

		<title>JavaScript Calculator</title>	
		<script language="JavaScript" type="text/javascript">
			function display(number)
				var x = document.form1.displayText;
				x.value = number;
        <form name="form1">
			<input type="text" name="displayText" size="30">
			<td><input type="submit" value="7" name="button7"
			<td><input type="submit" value="8" name="button8"
			<td><input type="submit" value="9" name="button9"
			<td><input type="submit" value="/" name="buttonDivide"></td>
			<td><input type="submit" value="sqrt" name="buttonRoot"></td>
			<td><input type="submit" value="4" name="button4"
			<td><input type="submit" value="5" name="button5"
			<td><input type="submit" value="6" name="button6"
			<td><input type="submit" value="*" name="buttonMultiply"></td>
			<td><input type="submit" value="^2" name="buttonSquare"></td>
			<td><input type="submit" value="1" name="button1"
			<td><input type="submit" value="2" name="button2"
			<td><input type="submit" value="3" name="button3"
			<td><input type="submit" value="-" name="buttonMinus"></td>
			<td><input type="submit" value="1/x" name="buttonOneX"></td>
			<td><input type="submit" value="0" name="button0"
			<td><input type="submit" value="." name="buttonPeriod"></td>
			<td><input type="submit" value="+/-" name="buttonPlusOrMinus"></td>
			<td><input type="submit" value="+" name="buttonPlus"></td>
			<td><input type="submit" value="=" name="buttonEquals"></td>

That's exactly what's happening, because of all your submit buttons. You are submitting the form... that's not what you want to do. Change all the "submit" to "button".

THANK YOU so much. I would have never spotted or known what was happening.

Thanks for helping.