Click to See Complete Forum and Search --> : Data from form into text!


PanikSpreder
06-27-2003, 01:06 PM
Hi!

I want to make a preview whenever I make a news for my site. So far I cant figure out how to get the info from the form over in the other page without using the submit button. I have been thinking about some Java but I dont know how to do! The code I use for the form is:

<?php
if($action == "nynyhed") {

echo "<form action=$SELF_PAGE?action=nynyhedexe method=POST name=nyhedentry>";
echo "BlastZone.dk Brugernavn:<br>";
echo "<input type=text size=30 name=handle><br><br>";

echo "Email:<br>";
echo "<input type=text size=30 name=email><br><br>";

echo "Titel:<br>";
echo "<input type=text size=30 maxlength=50 name=titel><br><br>";

echo "Ikon:<br>";
echo "<input type=text size=30 name=ikon maxlength=20 value=blastzone.gif><br><br>";

echo "Nyhed:<br>";
echo "<textarea name=nyhed cols=45 rows=10></textarea><br><br>";
echo '<input type=submit name=submitnyhed value=" Tilføj Nyhed "><br>';

echo "</form>";

}

?>

<?php
if($action == "previewnyhed") {

???

}
?>

Yeah, I'm using PHP as it is right now, but I cant figure this out. Would be kind of nice to see a preview before I actually post a news... hope that anybody can help me?

-PanikSpreder
www.blastzone.dk

Aronya1
06-30-2003, 12:14 PM
Panik,

If I understand your question properly, you just want to see how your changes will look before you upload them to your server, correct? If so, why not create a local version of your files & test it that way? Just alter your PHP code to update a local file, rather than the remote file. Or am I missing something?

PanikSpreder
06-30-2003, 12:32 PM
I have found a solution... something like Aronya1 said.
Thanks!

-PanikSpreder
www.blastzone.dk

Aronya1
07-01-2003, 12:04 AM
So...? Feel like sharing the wealth? What did you do to solve your problem?

PanikSpreder
07-01-2003, 03:09 AM
I use some code that looks like this:

<form method='post' name='form'>

<input wrap=virtual type=text type=text size=30 name=handle>

<input type='submit' value=' Opdater Nyhed ' name='tekst' onClick="document.form.action='test.php?action=editnewsexe';target='_self';">
<input type='submit' value=' Preview ' onClick="document.form.action='test.php?action=previewnews';target='_blank';">

</form>

Thats it...