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;
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
add a comment |
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
add a comment |
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
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
javascript jquery quill
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
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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