View Full Version : Spaces between inputted paragraphs
imagined
March 4th, 2004, 10:48 AM
Hello!
I'm writing this form where you enter information and when you click SUBMIT, it writes the data in a MySql database. But it doesn't keep track of the spaces between paragraphs.
I want it to respect the paragraphs. Just like here. I have written 3 paragraphs already and when I click Submit New Thread, and I look at my message. It contains the different paragraphs.
How can I do this too? I'm using PHP and MySql.
Thanks!
kill.robot.kill
March 4th, 2004, 10:51 AM
my guess is that is coded into the form itself via javascript, but I bet you could throw a string function on text block to look for carraige returns. I'm not exactly sure though, I am interested in seeing what other people say.
imagined
March 4th, 2004, 10:53 AM
This is the form:
<form action="<?=$_SERVER['display.php']?>" method="post">
<p>Type your content here:<br />
<textarea name="content" rows="10" cols="40" wrap>
</textarea><br />
<input type="submit" name="submitContent" value="SUBMIT" />
</p></form>
imagined
March 4th, 2004, 01:39 PM
Also, you see how if you click EDIT you own comment. A text area appears with what you typed. And then you just delete a couple of words and add a couple of words, and then Submit.
How can I do this too?
I'm just a beginner. Please help!
:ne:
Jubba
March 4th, 2004, 03:58 PM
$theVar = str_replace("\n", "<br />", $theVar);
that will do it for ya.
kill.robot.kill
March 4th, 2004, 04:04 PM
as far as the text box displaying what was previously written, you need to make the value of the text box, what that specific item in the database is. something like this.
<input type="text" name="textbox_name" value="<?php echo $row_from_your_database['value_here']; ?>" size="32">
that way, the value will be put into the textbox, where you can edit away.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.