Sunday, March 29, 2020

Re: Retaining text in search input boxes

Your solution was to set the 'value' attribute to the value that was entered in the input box.  That worked for the text input with the exception of the ones that got their value from a drop down list.  Please see my html code elsewhere in this post.  If you have any ideas, I would really appreciate it.  Thanks for your previous ideas.

On Saturday, February 15, 2020 at 1:16:18 PM UTC-6, OnlineJudge95 wrote:
On Sun, Feb 16, 2020 at 12:22 AM Dick Arnold <darno...@gmail.com> wrote:
I have a personnel database which has to be edited to keep it current.
I have created search parameters to find the person to edit.
The exact name of the person is not always known, therefore the name field for searching can contain only a few of the characters.  This can create a list of several people.
After the search parameters are entered a "Search" button is clicked and the output, if any, is displayed in a table.
If the search parameters need to be improved, I want the original (current) search argument to be retained in the argument field so I do not need to re-type ALL the search parameters, just the ones I want to change.

I have not been able to find a way to retain the value in the search input box,

Does anyone know how to accomplish this?

Here's the input for one of the input boxes.

<input type="text" id="name_id" name="name_id" placeholder="Enter a few characters">

Set an attribute of value in your input tags, and use the form object in your view to populate it. For reference https://stackoverflow.com/questions/4880306/django-multiple-forms-and-keep-field-data-input-after-submission?rq=1 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/92cfccd1-5916-4817-ae46-c612aa462610%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e49c313a-185c-4764-90c7-bbf748fef11a%40googlegroups.com.

No comments:

Post a Comment