Clearing specific quill fields using a buttonjQuery get specific option tag textHow to insert an item into an array at a specific index (JavaScript)?How can I know which radio button is selected via jQuery?Submitting a form on 'Enter' with jQuery?Generating random whole numbers in JavaScript in a specific range?How to clear the canvas for redrawingSubmit form with Enter key without submit button?How to clear all input fields in a specific div with jQuery?Stale data with StimulusJS and Quill editorQuill Chrome Extension Youtube hotkeys

Is there a typical layout to blocking installed for backing in new construction framing?

Boss has banned cycling to work because he thinks it's unsafe

Show that there are infinitely more problems than we will ever be able to compute

PhD: When to quit and move on?

What is the difference between a historical drama and a period drama?

Who pays for increased security measures on flights to the US?

How can I define a very large matrix efficiently?

How do both sides know the MTU

Could you sell yourself into slavery in the USA?

Do intermediate subdomains need to exist?

Should I hide my travel history to the UK when I apply for an Australian visa?

Taking advantage when the HR forgets to communicate the rules

Bypass with wrong cvv of debit card and getting OTP

How to respond to someone who condemns behavior similar to what they exhibit?

What is the maximum amount of diamond in one Minecraft game?

Why do we need a bootloader separate than our application program in MCU's?

Why did moving the mouse cursor cause Windows 95 to run more quickly?

Does taking on an assistant professor position prevent me from doing post-docs later?

Sleepy tired vs physically tired

What is meant by perfect, imperfect consonance and dissonance?

Has there ever been a cold war other than between the U.S. and the U.S.S.R.?

What/Where usage English vs Japanese

Why does the Batman "crack his knuckles" in "Batman: Arkham Origins"?

Does Evolution Sage proliferate Blast Zone when played?



Clearing specific quill fields using a button


jQuery get specific option tag textHow to insert an item into an array at a specific index (JavaScript)?How can I know which radio button is selected via jQuery?Submitting a form on 'Enter' with jQuery?Generating random whole numbers in JavaScript in a specific range?How to clear the canvas for redrawingSubmit form with Enter key without submit button?How to clear all input fields in a specific div with jQuery?Stale data with StimulusJS and Quill editorQuill Chrome Extension Youtube hotkeys






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am using Quilljs 1.3.6. I want to add a button on an HTML form that will clear specific quilljs fields.



When I use jquery on any input text field, all I have to do is create a button that calls a javascript function, that deletes the content a field(s). For example:



HTML



<label for="strengths">How strong are you?<label>
<input type='text' name='strengths' id='strengths'>

<input type="button" onclick="clearTextField()">Clear Field</button>


Javascript File



function clearTextField() 
$('#strengths').val('');



How do I clear a quilljs field? I tried to do something like this:



HTML



<label for="strengths">How strong are you?<label>
<input type="hidden" name="strengths">
<div id="strengths-container">
<p>Blah Blah Blah</p>
</div>
<input type="button" onclick="clearTextField()">Clear Field</button>


Javascript File



function clearTextField() 
strengths.setContents([]);



However, this won't work, because the 'strengths' object was created in a different javascript function. And the scope of 'strengths' is limited to the function that instantiated it.



var strengths = new Quill("#strengths-container", 
modules:
toolbar: toolbaroptions
,
theme: "snow"
);


So, this Quilljs method not work.



function clearTextField() 
strengths.setContents([]);



I am trying to make the <div id="strengths-container'> clear the value:



<p>Blah Blah Blah</p>


I do not want to use an HTML reset button, because there are other form fields that I do not want to clear when clicking on the button to clear the Quilljs field(s).










share|improve this question






























    0















    I am using Quilljs 1.3.6. I want to add a button on an HTML form that will clear specific quilljs fields.



    When I use jquery on any input text field, all I have to do is create a button that calls a javascript function, that deletes the content a field(s). For example:



    HTML



    <label for="strengths">How strong are you?<label>
    <input type='text' name='strengths' id='strengths'>

    <input type="button" onclick="clearTextField()">Clear Field</button>


    Javascript File



    function clearTextField() 
    $('#strengths').val('');



    How do I clear a quilljs field? I tried to do something like this:



    HTML



    <label for="strengths">How strong are you?<label>
    <input type="hidden" name="strengths">
    <div id="strengths-container">
    <p>Blah Blah Blah</p>
    </div>
    <input type="button" onclick="clearTextField()">Clear Field</button>


    Javascript File



    function clearTextField() 
    strengths.setContents([]);



    However, this won't work, because the 'strengths' object was created in a different javascript function. And the scope of 'strengths' is limited to the function that instantiated it.



    var strengths = new Quill("#strengths-container", 
    modules:
    toolbar: toolbaroptions
    ,
    theme: "snow"
    );


    So, this Quilljs method not work.



    function clearTextField() 
    strengths.setContents([]);



    I am trying to make the <div id="strengths-container'> clear the value:



    <p>Blah Blah Blah</p>


    I do not want to use an HTML reset button, because there are other form fields that I do not want to clear when clicking on the button to clear the Quilljs field(s).










    share|improve this question


























      0












      0








      0








      I am using Quilljs 1.3.6. I want to add a button on an HTML form that will clear specific quilljs fields.



      When I use jquery on any input text field, all I have to do is create a button that calls a javascript function, that deletes the content a field(s). For example:



      HTML



      <label for="strengths">How strong are you?<label>
      <input type='text' name='strengths' id='strengths'>

      <input type="button" onclick="clearTextField()">Clear Field</button>


      Javascript File



      function clearTextField() 
      $('#strengths').val('');



      How do I clear a quilljs field? I tried to do something like this:



      HTML



      <label for="strengths">How strong are you?<label>
      <input type="hidden" name="strengths">
      <div id="strengths-container">
      <p>Blah Blah Blah</p>
      </div>
      <input type="button" onclick="clearTextField()">Clear Field</button>


      Javascript File



      function clearTextField() 
      strengths.setContents([]);



      However, this won't work, because the 'strengths' object was created in a different javascript function. And the scope of 'strengths' is limited to the function that instantiated it.



      var strengths = new Quill("#strengths-container", 
      modules:
      toolbar: toolbaroptions
      ,
      theme: "snow"
      );


      So, this Quilljs method not work.



      function clearTextField() 
      strengths.setContents([]);



      I am trying to make the <div id="strengths-container'> clear the value:



      <p>Blah Blah Blah</p>


      I do not want to use an HTML reset button, because there are other form fields that I do not want to clear when clicking on the button to clear the Quilljs field(s).










      share|improve this question
















      I am using Quilljs 1.3.6. I want to add a button on an HTML form that will clear specific quilljs fields.



      When I use jquery on any input text field, all I have to do is create a button that calls a javascript function, that deletes the content a field(s). For example:



      HTML



      <label for="strengths">How strong are you?<label>
      <input type='text' name='strengths' id='strengths'>

      <input type="button" onclick="clearTextField()">Clear Field</button>


      Javascript File



      function clearTextField() 
      $('#strengths').val('');



      How do I clear a quilljs field? I tried to do something like this:



      HTML



      <label for="strengths">How strong are you?<label>
      <input type="hidden" name="strengths">
      <div id="strengths-container">
      <p>Blah Blah Blah</p>
      </div>
      <input type="button" onclick="clearTextField()">Clear Field</button>


      Javascript File



      function clearTextField() 
      strengths.setContents([]);



      However, this won't work, because the 'strengths' object was created in a different javascript function. And the scope of 'strengths' is limited to the function that instantiated it.



      var strengths = new Quill("#strengths-container", 
      modules:
      toolbar: toolbaroptions
      ,
      theme: "snow"
      );


      So, this Quilljs method not work.



      function clearTextField() 
      strengths.setContents([]);



      I am trying to make the <div id="strengths-container'> clear the value:



      <p>Blah Blah Blah</p>


      I do not want to use an HTML reset button, because there are other form fields that I do not want to clear when clicking on the button to clear the Quilljs field(s).







      javascript jquery quill






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 10:41









      Flimzy

      42.9k13 gold badges71 silver badges108 bronze badges




      42.9k13 gold badges71 silver badges108 bronze badges










      asked Mar 25 at 18:38









      PhilPhil

      11 bronze badge




      11 bronze badge






















          0






          active

          oldest

          votes










          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%2f55344450%2fclearing-specific-quill-fields-using-a-button%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          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%2f55344450%2fclearing-specific-quill-fields-using-a-button%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현