morgaine @ Sun Mar 11, 2007 2:52 am wrote:
for appending the value of one text box to another, you really don't need a server-side language, JavaScript is the easiest way to go.
That said, here's what you can do in php: (copy and paste the following into a file called sample.php to test it out)
<html>
<body>
<?php $_GET['list'].=($_GET['list']=='' ? $_GET['name']:"\n".$_GET['name']) ?>
<form action="sample.php" method="get">
Name: <input type='text' name='name' />
<input type='submit' value='submit' /><br />
<textarea name='list'>
<?php echo $_GET['list'] ?>
</textarea>
</form>
</body>
</html>
Hello Morgaine this code was very helpful for me!!
but when i am opening the sample.php over the web, i am getting 3 errors:
1,) at line 3 (<?php $_GET['list'].=($_GET['list']=='' ? $_GET['name']:"\n".$_GET['name']) ?> ) "Undefined Index List on line 3"
2.) Undefined index name on line 3
3.) undefined index list on line 3
what should i do?