Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:00:33+00:00 2026-06-13T08:00:33+00:00

I just had one doubt: I have a form where I do server side

  • 0

I just had one doubt:

I have a form where I do server side validation.. i have np with validation, BUT the prob is:

In a Form, assume I entered some 9 fields (instead of 10 ), it shows me an erros saying that ’10th field missing’ and all the data I entered in 9 fields has to be re-entered again.. (sometimes its really damn tough to re-enter same data because of small mistake )

so, aim thinking that whatever the data entered previously in textfield or textarea or some other html element, it should be saved automatically even after server validation does.. so that user need not re-type again..

how can I achive this.. I tried in google, but didnt understood how to search for this kind of sittuation and i did not find any solution yet..

sory for my bad english.. Hope u udnerstood my prob..

so, any suggestions..?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:00:34+00:00Added an answer on June 13, 2026 at 8:00 am

    @Jim, this is the same situation as in your original question.
    (Before anybody points out that it is a different account, it’s the same actual person – long story!)

    PHP will not keep the “state” of the control when you send it back to the browser after a post-back.

    So instead of sending back the following each and every time…

    <input type="text" id="mytext" name="mytext">
    

    You need to send back what was originally entered as part of the control…

    <input type="text" id="mytext" name="mytext"
       value="<?php echo $_POST['mytext']; ?>>
    

    With checkboxes and radios (which was your original question), you need something like…

    <input type="checkbox" id="mycheck" name="mycheck"
       value="<?php echo (isset($_POST['mycheck']) ? "checked" : ""); ?>>
    

    And as you’re talking about <textarea> controls, you’d do something like…

    <textarea id="mytext" name="mytext"><?php echo $_POST['mytext']; ?></textarea>
    

    Update

    As you are building the HTML into the $echo string variable (rather than just having the HTML mark up directly), you need to include the above code as part of the string.

    If you do an echo command during the building of the string, the thing being echoed will be sent to the screen straight away. Then when you send the contents of $echo via the command echo $echo; you get everything else.

    So, for a single line textbox you would do…

    $echo = '<input type="text" id="mytext" name="mytext" value="'. $_POST['mytext'] .'">';
    

    For a checkbox you would do…

    $echo = '<input type="checkbox" id="mycheck" name="mycheck" '. (isset($_POST['mycheck']) ? "checked" : "") .'>';
    

    For a multi line textbox you would do….

    $echo = '<textarea id="mytext" name="mytext">'. $_POST['mytext'] . '</textarea>';
    

    So you see that we are including the existing value of the control as part of the string that you are building.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On our local dev enviornment we had just one server and to add far
For example if I had one or more 2D vectors and I just want
I just had an interesting experience with a startup form in MS Access 2010.
I just had a NHibernate related problem where I forgot to map one property
I just had this throw a compilation error while refactoring some legacy (hence VB.NET)
Just found a piece of my code that had one original typo in it.
I've just had my first experience with rewriting the history of one of my
Let me start off by saying I had one DLL loading in just fine.
I have oracle 10.2.0.4 version..Some days before everything was well..but after changing tnsnames.ora file(I
I'm new to EMR and just had a few questions i have been struggling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.