Sorry about the amount of time it has taken me respond to your post.  I 
have been in the hospital.
I have been able to fix everything except the drop down boxes.  I'll show 
some code first.

    <div class="row">
      <div class="col-25">
        <label for="ctype_id">Contact Type</label>
      </div>
      <div class="col-75">
        <select name='ctype_id'>
          <option value=" ">        </option>
          <option value="P">P Player</option>
          <option value="V">V Vendor</option>
        </select>
          <input type="text" id="ctype_id" hidden value="{{ctype_id}}">
      </div>
    </div>

I've been able to use the 'value' attribute to retain the search option 
that was chosen.  The field is actually defined as 'character' with a max 
length of 1.  This technique does not work for drop down lists.  The input 
field (box) still contains nothing.  I erased the 'hidden' word as I 
couldn't decide what it did.  It created a second input field (box) below 
the original box, so now I have two input boxes for this operation.  The 
second box does show the correct, one character value that was entered.  
But is need to put it in the first box, not the second. 

I tried another technique, but it does the same thing.  Here is that code 
(it's for a different drop down list):

    <div class="row">
      <div class="col-25">
        <label for="ltype_id">Level of Play</label>
      </div>
      <div class="col-75">
        <select name='ltype_id'>
          <option value=" ">          </option>
          <option value="A">A Advanced</option>
          <option value="N">N Novice  </option>
          <option value="O">O Open    </option>
          <option value="U">U Unknown </option>
        </select>
          <input type="text" id="ltype_id" hidden value="{{ltype_id}}"
                 onclick="retainLParm">
      </div>
    </div>
      <script>
        function retainLParm() {
          document.getElementById("ltype_id").defaultValue="{{ltype_id}}";
        } 
      </script>

Have I missed something that was In your post?  I've read and tried every 
thing I could.  I'm getting very frustrated.  The problem is...  I'm a 
mainframe programmer.  Python and Django and HTML and CSS are all brand new 
for me.  I'm getting better though.

Thanks for any help.

On Thursday, February 20, 2020 at 4:55:23 AM UTC-6, Mr Guro wrote:
>
> For drop downs use JavaScript script or JQuery to set the value of the 
> value of the selected item.For input use an if on the value if it's 
> populated then the input value is equal to the attribute us you put it 
> .Another option is to use the default on attribute but make it an empty 
> string so you don't have none when attribute is empty .
>
> On Thu, Feb 20, 2020, 12:14 PM Dick Arnold <darno...@gmail.com 
> <javascript:>> wrote:
>
>> I used a value of {{attribute value}}.  so it is nor a fixed value, but 
>> is the value submitted.  Doesn't work well for drop down input fields.  
>> still researching.
>>
>> On Saturday, February 15, 2020 at 12:50:59 PM UTC-6, Dick Arnold 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">
>>>
>> -- 
>> 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 <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/77088a26-742b-4bb4-8f2f-b74c5375119d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/77088a26-742b-4bb4-8f2f-b74c5375119d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3f152d2b-6a10-4c15-af82-c47bb010032a%40googlegroups.com.

Reply via email to