and issue: only one viewed in the list, the initial value of the












0















Some datalists are not viewed properly. Only the initial value of the input is proposed in the datalist.Where is my fault ?



I generate with php and data from Amazon, Google and French BnF (National Library) some datalists so that the user may choose his proper information.
It works most of the time (95%). But I get issues with some datalists. Only one option is viewed, the initial value of the input.



Code 1:



  <input    id="author" name="item_author" value="Sophie de  Ségur"  onchange="javascript:submit();"    list="data_author">
<datalist id="data_author">
<option value="Comtesse de Ségur">Amazon</option>
<option value="Comtesse de Ségur">BnF</option>
<option value="Sophie Rostopchine de Ségur">Google</option>
<option value="Sophie de Ségur">BnF</option>
<option value=" Bertall">BnF</option>
</datalist>


Result code 1:
Only fourth option viewed (initial value of input).



Example 2:



  <input    id="author" name="item_author" value="Catherine  Ard"  onchange="javascript:submit();"  list="data_author">
<datalist id="data_author">
<option value="Mickael Wiles">Amazon</option>
<option value="[textes par Catherine Ard]">BnF</option>
<option value="Catherine Ard">BnF</option>
</datalist>


Result code 2:
Only last option viewed (initial value of input)



Example 3:



  <input    id="publisher" name="item_publisher" value="Gallimard jeunesse"  onchange="javascript:submit();"    list="data_publisher">
<datalist id="data_publisher">
<option value="Editions Gallimard">Amazon</option>
<option value="Gallimard jeunesse">BnF</option>
</datalist>


result code 3:
Only last option viewed (initial value of input)



In all 3 examples, when I click on the arrow at the right of the input (on chrome), I expect to get a menu with all options.
But I get only the option that is the value of the input.










share|improve this question

























  • Possible duplicate of How can I make a browser display all datalist options when a default value is set?

    – Bryan Dellinger
    Jan 3 at 0:01
















0















Some datalists are not viewed properly. Only the initial value of the input is proposed in the datalist.Where is my fault ?



I generate with php and data from Amazon, Google and French BnF (National Library) some datalists so that the user may choose his proper information.
It works most of the time (95%). But I get issues with some datalists. Only one option is viewed, the initial value of the input.



Code 1:



  <input    id="author" name="item_author" value="Sophie de  Ségur"  onchange="javascript:submit();"    list="data_author">
<datalist id="data_author">
<option value="Comtesse de Ségur">Amazon</option>
<option value="Comtesse de Ségur">BnF</option>
<option value="Sophie Rostopchine de Ségur">Google</option>
<option value="Sophie de Ségur">BnF</option>
<option value=" Bertall">BnF</option>
</datalist>


Result code 1:
Only fourth option viewed (initial value of input).



Example 2:



  <input    id="author" name="item_author" value="Catherine  Ard"  onchange="javascript:submit();"  list="data_author">
<datalist id="data_author">
<option value="Mickael Wiles">Amazon</option>
<option value="[textes par Catherine Ard]">BnF</option>
<option value="Catherine Ard">BnF</option>
</datalist>


Result code 2:
Only last option viewed (initial value of input)



Example 3:



  <input    id="publisher" name="item_publisher" value="Gallimard jeunesse"  onchange="javascript:submit();"    list="data_publisher">
<datalist id="data_publisher">
<option value="Editions Gallimard">Amazon</option>
<option value="Gallimard jeunesse">BnF</option>
</datalist>


result code 3:
Only last option viewed (initial value of input)



In all 3 examples, when I click on the arrow at the right of the input (on chrome), I expect to get a menu with all options.
But I get only the option that is the value of the input.










share|improve this question

























  • Possible duplicate of How can I make a browser display all datalist options when a default value is set?

    – Bryan Dellinger
    Jan 3 at 0:01














0












0








0








Some datalists are not viewed properly. Only the initial value of the input is proposed in the datalist.Where is my fault ?



I generate with php and data from Amazon, Google and French BnF (National Library) some datalists so that the user may choose his proper information.
It works most of the time (95%). But I get issues with some datalists. Only one option is viewed, the initial value of the input.



Code 1:



  <input    id="author" name="item_author" value="Sophie de  Ségur"  onchange="javascript:submit();"    list="data_author">
<datalist id="data_author">
<option value="Comtesse de Ségur">Amazon</option>
<option value="Comtesse de Ségur">BnF</option>
<option value="Sophie Rostopchine de Ségur">Google</option>
<option value="Sophie de Ségur">BnF</option>
<option value=" Bertall">BnF</option>
</datalist>


Result code 1:
Only fourth option viewed (initial value of input).



Example 2:



  <input    id="author" name="item_author" value="Catherine  Ard"  onchange="javascript:submit();"  list="data_author">
<datalist id="data_author">
<option value="Mickael Wiles">Amazon</option>
<option value="[textes par Catherine Ard]">BnF</option>
<option value="Catherine Ard">BnF</option>
</datalist>


Result code 2:
Only last option viewed (initial value of input)



Example 3:



  <input    id="publisher" name="item_publisher" value="Gallimard jeunesse"  onchange="javascript:submit();"    list="data_publisher">
<datalist id="data_publisher">
<option value="Editions Gallimard">Amazon</option>
<option value="Gallimard jeunesse">BnF</option>
</datalist>


result code 3:
Only last option viewed (initial value of input)



In all 3 examples, when I click on the arrow at the right of the input (on chrome), I expect to get a menu with all options.
But I get only the option that is the value of the input.










share|improve this question
















Some datalists are not viewed properly. Only the initial value of the input is proposed in the datalist.Where is my fault ?



I generate with php and data from Amazon, Google and French BnF (National Library) some datalists so that the user may choose his proper information.
It works most of the time (95%). But I get issues with some datalists. Only one option is viewed, the initial value of the input.



Code 1:



  <input    id="author" name="item_author" value="Sophie de  Ségur"  onchange="javascript:submit();"    list="data_author">
<datalist id="data_author">
<option value="Comtesse de Ségur">Amazon</option>
<option value="Comtesse de Ségur">BnF</option>
<option value="Sophie Rostopchine de Ségur">Google</option>
<option value="Sophie de Ségur">BnF</option>
<option value=" Bertall">BnF</option>
</datalist>


Result code 1:
Only fourth option viewed (initial value of input).



Example 2:



  <input    id="author" name="item_author" value="Catherine  Ard"  onchange="javascript:submit();"  list="data_author">
<datalist id="data_author">
<option value="Mickael Wiles">Amazon</option>
<option value="[textes par Catherine Ard]">BnF</option>
<option value="Catherine Ard">BnF</option>
</datalist>


Result code 2:
Only last option viewed (initial value of input)



Example 3:



  <input    id="publisher" name="item_publisher" value="Gallimard jeunesse"  onchange="javascript:submit();"    list="data_publisher">
<datalist id="data_publisher">
<option value="Editions Gallimard">Amazon</option>
<option value="Gallimard jeunesse">BnF</option>
</datalist>


result code 3:
Only last option viewed (initial value of input)



In all 3 examples, when I click on the arrow at the right of the input (on chrome), I expect to get a menu with all options.
But I get only the option that is the value of the input.







html html-datalist






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 0:06









j08691

167k20197215




167k20197215










asked Jan 2 at 23:57









FranckFranck

11




11













  • Possible duplicate of How can I make a browser display all datalist options when a default value is set?

    – Bryan Dellinger
    Jan 3 at 0:01



















  • Possible duplicate of How can I make a browser display all datalist options when a default value is set?

    – Bryan Dellinger
    Jan 3 at 0:01

















Possible duplicate of How can I make a browser display all datalist options when a default value is set?

– Bryan Dellinger
Jan 3 at 0:01





Possible duplicate of How can I make a browser display all datalist options when a default value is set?

– Bryan Dellinger
Jan 3 at 0:01












1 Answer
1






active

oldest

votes


















0














Problem is linked to autocomplete of "input" with its initial value, an autocomplete that can't be switched "off".



So solution in the context of "onchange="javascript:submit();"" is to use 2 "input".



First "input" with datalist, value="" and onmousedown="value = '';" in the short width "input".



Second "input" with the initial value.



NB1: Depending on the "form" context, you may use two different "name" for the two "input" (and processed them in PHP or JS).



NB2: cause of width constraint (nicer and smaller MMI), I prefer an "input" with a datalist rather than a "select".



Solution for example 1:



  <input    id="author" name="item_author" onchange="javascript:submit();"  list="data_author" onmousedown="value = '';" style="width:5vmin;">
<datalist id="data_author">
<option value="Comtesse de Ségur">Amazon</option>
<option value="Comtesse de Ségur">BnF</option>
<option value="Sophie Rostopchine de Ségur">Google</option>
<option value="Sophie de Ségur">BnF</option>
<option value=" Bertall">BnF</option>
</datalist>
<input id="author" name="item_author" value="Sophie de Ségur" onchange="javascript:submit();">


Thanks to:




  • Bryan Dellinger: https://stackoverflow.com/users/2744722/bryan-dellinger for his proposal ;

  • analysis in: How to turn off autocomplete while keep using datalist element in html ;

  • "binary" j08691: https://stackoverflow.com/users/616443/j08691 (in memory of the binary reverse engineering of my "Sharp PC 1245" in the 80's).






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014727%2finput-and-datalist-issue-only-one-option-viewed-in-the-list-the-initial%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Problem is linked to autocomplete of "input" with its initial value, an autocomplete that can't be switched "off".



    So solution in the context of "onchange="javascript:submit();"" is to use 2 "input".



    First "input" with datalist, value="" and onmousedown="value = '';" in the short width "input".



    Second "input" with the initial value.



    NB1: Depending on the "form" context, you may use two different "name" for the two "input" (and processed them in PHP or JS).



    NB2: cause of width constraint (nicer and smaller MMI), I prefer an "input" with a datalist rather than a "select".



    Solution for example 1:



      <input    id="author" name="item_author" onchange="javascript:submit();"  list="data_author" onmousedown="value = '';" style="width:5vmin;">
    <datalist id="data_author">
    <option value="Comtesse de Ségur">Amazon</option>
    <option value="Comtesse de Ségur">BnF</option>
    <option value="Sophie Rostopchine de Ségur">Google</option>
    <option value="Sophie de Ségur">BnF</option>
    <option value=" Bertall">BnF</option>
    </datalist>
    <input id="author" name="item_author" value="Sophie de Ségur" onchange="javascript:submit();">


    Thanks to:




    • Bryan Dellinger: https://stackoverflow.com/users/2744722/bryan-dellinger for his proposal ;

    • analysis in: How to turn off autocomplete while keep using datalist element in html ;

    • "binary" j08691: https://stackoverflow.com/users/616443/j08691 (in memory of the binary reverse engineering of my "Sharp PC 1245" in the 80's).






    share|improve this answer




























      0














      Problem is linked to autocomplete of "input" with its initial value, an autocomplete that can't be switched "off".



      So solution in the context of "onchange="javascript:submit();"" is to use 2 "input".



      First "input" with datalist, value="" and onmousedown="value = '';" in the short width "input".



      Second "input" with the initial value.



      NB1: Depending on the "form" context, you may use two different "name" for the two "input" (and processed them in PHP or JS).



      NB2: cause of width constraint (nicer and smaller MMI), I prefer an "input" with a datalist rather than a "select".



      Solution for example 1:



        <input    id="author" name="item_author" onchange="javascript:submit();"  list="data_author" onmousedown="value = '';" style="width:5vmin;">
      <datalist id="data_author">
      <option value="Comtesse de Ségur">Amazon</option>
      <option value="Comtesse de Ségur">BnF</option>
      <option value="Sophie Rostopchine de Ségur">Google</option>
      <option value="Sophie de Ségur">BnF</option>
      <option value=" Bertall">BnF</option>
      </datalist>
      <input id="author" name="item_author" value="Sophie de Ségur" onchange="javascript:submit();">


      Thanks to:




      • Bryan Dellinger: https://stackoverflow.com/users/2744722/bryan-dellinger for his proposal ;

      • analysis in: How to turn off autocomplete while keep using datalist element in html ;

      • "binary" j08691: https://stackoverflow.com/users/616443/j08691 (in memory of the binary reverse engineering of my "Sharp PC 1245" in the 80's).






      share|improve this answer


























        0












        0








        0







        Problem is linked to autocomplete of "input" with its initial value, an autocomplete that can't be switched "off".



        So solution in the context of "onchange="javascript:submit();"" is to use 2 "input".



        First "input" with datalist, value="" and onmousedown="value = '';" in the short width "input".



        Second "input" with the initial value.



        NB1: Depending on the "form" context, you may use two different "name" for the two "input" (and processed them in PHP or JS).



        NB2: cause of width constraint (nicer and smaller MMI), I prefer an "input" with a datalist rather than a "select".



        Solution for example 1:



          <input    id="author" name="item_author" onchange="javascript:submit();"  list="data_author" onmousedown="value = '';" style="width:5vmin;">
        <datalist id="data_author">
        <option value="Comtesse de Ségur">Amazon</option>
        <option value="Comtesse de Ségur">BnF</option>
        <option value="Sophie Rostopchine de Ségur">Google</option>
        <option value="Sophie de Ségur">BnF</option>
        <option value=" Bertall">BnF</option>
        </datalist>
        <input id="author" name="item_author" value="Sophie de Ségur" onchange="javascript:submit();">


        Thanks to:




        • Bryan Dellinger: https://stackoverflow.com/users/2744722/bryan-dellinger for his proposal ;

        • analysis in: How to turn off autocomplete while keep using datalist element in html ;

        • "binary" j08691: https://stackoverflow.com/users/616443/j08691 (in memory of the binary reverse engineering of my "Sharp PC 1245" in the 80's).






        share|improve this answer













        Problem is linked to autocomplete of "input" with its initial value, an autocomplete that can't be switched "off".



        So solution in the context of "onchange="javascript:submit();"" is to use 2 "input".



        First "input" with datalist, value="" and onmousedown="value = '';" in the short width "input".



        Second "input" with the initial value.



        NB1: Depending on the "form" context, you may use two different "name" for the two "input" (and processed them in PHP or JS).



        NB2: cause of width constraint (nicer and smaller MMI), I prefer an "input" with a datalist rather than a "select".



        Solution for example 1:



          <input    id="author" name="item_author" onchange="javascript:submit();"  list="data_author" onmousedown="value = '';" style="width:5vmin;">
        <datalist id="data_author">
        <option value="Comtesse de Ségur">Amazon</option>
        <option value="Comtesse de Ségur">BnF</option>
        <option value="Sophie Rostopchine de Ségur">Google</option>
        <option value="Sophie de Ségur">BnF</option>
        <option value=" Bertall">BnF</option>
        </datalist>
        <input id="author" name="item_author" value="Sophie de Ségur" onchange="javascript:submit();">


        Thanks to:




        • Bryan Dellinger: https://stackoverflow.com/users/2744722/bryan-dellinger for his proposal ;

        • analysis in: How to turn off autocomplete while keep using datalist element in html ;

        • "binary" j08691: https://stackoverflow.com/users/616443/j08691 (in memory of the binary reverse engineering of my "Sharp PC 1245" in the 80's).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 1:09









        FranckFranck

        11




        11
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014727%2finput-and-datalist-issue-only-one-option-viewed-in-the-list-the-initial%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas