I have two textboxes and when I enter values in them, I want them to be displayed on the screen(not in a pop up window)...plz help me out!!!!

Recommended Answers

All 3 Replies

How this?

<?php
if($_POST['box1'])
{
echo $_POST['box1']."<br>".$_POST['box2'];
}
else
{
echo '<form method="post" action="">
<textarea name="box1"></textarea>
<textarea name="box2"></textarea>
<input type="submit" value="check">
</form>';
}
?>

How this?

<?php
if($_POST['box1'])
{
echo $_POST['box1']."<br>".$_POST['box2'];
}
else
{
echo '<form method="post" action="">
<textarea name="box1"></textarea>
<textarea name="box2"></textarea>
<input type="submit" value="check">
</form>';
}
?>

-------------------------Thnx for the reply...actually I am designing a form in html and implementing in javascript...I am sorry that I have posted in the wrong section...can you help me out?

In javascript with jquery framework(example for one textbox):

<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
  $("#btn").click(function () {
  $('#text').text($('#txt').val());
 
	});
  });
  </script>
  </head>
  <body>
<textarea id="txt">txt</textarea>
  <div id="text">txt</div><br />
  <button id="btn">Go!</button>
  </body>
  </html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.