Jump to content

prevent something from reload


simzam

Recommended Posts

Hi

is there any way we can prevent suppose <textarea></textarea> when page reload it refresh and set default text

i wanted to know is there any way to prevent certain things not to get refreshed  is there any method in php which prevent to reload  this !

 

 

<?php

echo  "<textarea > Enter your favorite quote!</textarea> \n" ;

if (isset($_GET['edit']) && $_GET['edit'] == 'textupdate'){
}
<a href= \"{$_SERVER['PHP_SELF']}?page=1&edit=textupdate \" >Click</a>

?>

Link to comment
Share on other sites

So you want to be able to refresh/reload the page but have the textarea retain its value even if the user changes the value then reloads the page?

 

The only way I can think of is to post the contents of the textarea using AJAX regularly, e.g. every 30seconds and save the contents somewhere so that when the page reloads, you can lookup the last saved contents and show it.

Link to comment
Share on other sites

I'm trying this but its not even working ! textarea should remember previous text value on refresh of page

if(isset($_SESSION["quote1"]))
$mysession= $_SESSION["quote1"];
else
$mysession= "";
echo  "Insert Row: <br> <textarea rows=\"1\"  cols=\"60\" name=\"quote1\"  id= \"textarea12\" wrap=\"physical\"  value= \"$mysession\"> \n";
echo "</textarea> \n";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.