Stay organized with collections
Save and categorize content based on your preferences.
blockly > Block > removeInput
Remove an input from this block.
Signature:
removeInput(name: string, opt_quiet?: boolean): boolean;
Parameters
Parameter |
Type |
Description |
name |
string |
The name of the input. |
opt_quiet |
boolean |
(Optional) True to prevent an error if input is not present. |
Returns:
boolean
True if operation succeeds, false if input is not present and opt_quiet is true.
Exceptions
{Error} if the input is not present and opt_quiet is not true.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eremoveInput()\u003c/code\u003e method is used to delete an input from a Blockly block using the input's name.\u003c/p\u003e\n"],["\u003cp\u003eThe method optionally takes a boolean, \u003ccode\u003eopt_quiet\u003c/code\u003e, to suppress errors if the specified input is not found.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eremoveInput()\u003c/code\u003e returns \u003ccode\u003etrue\u003c/code\u003e if the removal is successful, and \u003ccode\u003efalse\u003c/code\u003e if \u003ccode\u003eopt_quiet\u003c/code\u003e is true and the input doesn't exist.\u003c/p\u003e\n"],["\u003cp\u003eAn error is thrown if the input is not found and \u003ccode\u003eopt_quiet\u003c/code\u003e is not set to \u003ccode\u003etrue\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `Block.removeInput()` method removes an input from a block using the input's name. It accepts two parameters: `name` (a string specifying the input's name) and an optional `opt_quiet` (a boolean). If `opt_quiet` is true, the method returns false if the input is absent. If `opt_quiet` is false (or omitted) and the input is not found, it throws an error. The method returns `true` if the input is successfully removed.\n"],null,["[blockly](./blockly.md) \\\u003e [Block](./blockly.block_class.md) \\\u003e [removeInput](./blockly.block_class.removeinput_1_method.md)\n\nBlock.removeInput() method\n--------------------------\n\nRemove an input from this block.\n\n**Signature:** \n\n removeInput(name: string, opt_quiet?: boolean): boolean;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|---------|----------------------------------------------------------------|\n| name | string | The name of the input. |\n| opt_quiet | boolean | *(Optional)* True to prevent an error if input is not present. |\n\n**Returns:**\n\nboolean\n\nTrue if operation succeeds, false if input is not present and opt_quiet is true.\n\nExceptions\n----------\n\n{Error} if the input is not present and opt_quiet is not true."]]