Jump to content

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']:'';?>" />

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.