Rubendo Posted September 20, 2017 Share Posted September 20, 2017 (edited) Hi who can help me i will think him I have form field Name , Surname, Email When i putt submit value in those field must stay in field i want to do it with seesions TNX Edited September 20, 2017 by cyberRobot removed formatting Quote Link to comment Share on other sites More sharing options...
requinix Posted September 20, 2017 Share Posted September 20, 2017 Rubendo, if you want help here then you have to make a thread with a title that (briefly) describes what you are doing and a body that includes all the information we might need to know to help you. Because we don't know you, we don't know your site, and we don't know your code. We aren't psychic. Quote Link to comment Share on other sites More sharing options...
Phi11W Posted September 20, 2017 Share Posted September 20, 2017 When i putt submit value in those field must stay in field If I understand you correctly ... "Locking" the user into an invalid field gives a terrible User Experience, especially when you start having multiple fields that are validated with respect to one another. For example, given Start and End Dates, the user might enter the Start Date incorrectly but then gets "locked" into the End Date field because that is invalid with respect to the Start Date. Instead, validate all the fields, return/ display all the errors, then let the user sort out their own mess. Only once everything is valid do you allow the submit to continue. Regards, Phill W. Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted September 20, 2017 Share Posted September 20, 2017 i want to do it with seesions Sessions shouldn't be necessary. Is your form in the same PHP script as the code processing the form? If it is, you could use the POST or GET variables to repopulate the form when there are errors. If you are using separate scripts, the script processing the form could use a PHP redirect to send the information back to the form using GET variables (when there are errors). Quote Link to comment Share on other sites More sharing options...
ginerjm Posted September 20, 2017 Share Posted September 20, 2017 To retain the entries in your form fields when the script re-sends it back to the client, use the value= attribute on your input tags. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.