Jump to content

textarea help - imput text to be saved


robert.access

Recommended Posts

please help me with this.

 

On a page I have a form for user to insert a text and then another to upload image, but when images are uploaded the page it's automatcly refreshed and the text in  <textarea> dissapearand and need to be entered again.

 

How to fix this? If I move the images upload above the <textarea> for users first to upload and then enter the text it's ugly for design.

 

Please help Thank you!

Link to comment
https://forums.phpfreaks.com/topic/190437-textarea-help-imput-text-to-be-saved/
Share on other sites

well thanks for the big help but really don't know from where to start. the code is:

 

  </tr>
   <tr>
      <td colspan="3" class="mylabelstyle"><?=MSG_ITEM_TITLE;?>        <input name="name" type="text" id="name" value="<?=$item_details['name'];?>" size="60" maxlength="80" class="myinputstyle" /></td>
   </tr>
<tr >
      <td colspan="3"><script language="JavaScript" type="text/javascript" src='scripts/innovaeditor.php'></script><textarea id="description_main" name="description_main" style="width: 400px; height: 200px; overflow: hidden;" ><?=$item_details['description'];?></textarea>
      <?=$item_description_editor;?>      </td>
   </tr>
   <? echo ($setts['max_images'] > 0) ? $image_upload_manager : ''; ?>

 

 

the item title it's saved on page refresh.

do you need other code too??? thanks!

You can use sessions to persist the data. Basically when the user uploads the image store the post inputs you want saved in session. On the form page in the html input value you would have something like:

 

<input type="text" name="somename" value="<?php echo isset($_SESSION['somename'])?$_SESSION['somename']:'';?>" />

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.