{"id":1414,"date":"2023-08-12T16:01:03","date_gmt":"2023-08-12T15:01:03","guid":{"rendered":"https:\/\/codeflarelimited.com\/blog\/?p=1414"},"modified":"2023-08-12T16:01:04","modified_gmt":"2023-08-12T15:01:04","slug":"disable-button-on-empty-input-in-react-js","status":"publish","type":"post","link":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/","title":{"rendered":"Disable Button on Empty Input in React JS"},"content":{"rendered":"\n<p>In a React application, you can achieve the same functionality of disabling a button when an input is empty using React state and event handling.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-create-a-new-react-application\">1. Create a New React Application<\/h2>\n\n\n\n<p>The first thing we have to do is to create our React application using the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">npx create-react-app folder-name<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-add-bootstrap-styling\">2. Add Bootstrap Styling<\/h2>\n\n\n\n<p>We&#8217;re also going to add a little Bootstrap for ease of design. We will add the following code to our <strong><em>index.html<\/em><\/strong> file in the public folder of our application.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup\">  &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.1\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-4bw+\/aepP\/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9\" crossorigin=\"anonymous\"><\/code><\/pre>\n\n\n\n<p>Next, we will modify our App.js file as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">import React, { Component } from 'react';\n\nclass App extends Component{\n  render(){\n    return(\n  &lt;div className=\"container\">\n  &lt;form>\n  &lt;div class=\"mb-3 col-md-6\">\n  &lt;label for=\"exampleFormControlInput1\" class=\"form-label\">Email address&lt;\/label>\n  &lt;input onChange={(e) => this.getValue(e)} type=\"email\" class=\"form-control mb-4\" placeholder=\"name@example.com\" \/>\n  &lt;button type=\"button\" class=\"form-control btn btn-primary btn-lg\">Submit&lt;\/button>\n&lt;\/div>\n&lt;\/form>\n      &lt;\/div>\n    )\n  }\n}\n\nexport default App;\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"299\" src=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-2.36.13-AM.png\" alt=\"Disable button on empty input in React JS\" class=\"wp-image-1416\" srcset=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-2.36.13-AM.png 785w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-2.36.13-AM-300x114.png 300w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-2.36.13-AM-768x293.png 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-set-initial-state-of-application\">3. Set Initial State of Application<\/h2>\n\n\n\n<p>We need to set initial state for our application. What we want is that as the application loads initially, let the button be disabled and then we can conditionally check for input.<\/p>\n\n\n\n<p>We will set the state as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">constructor(props){\n    super(props);\n    this.state = {\n      isDisabled: false,\n      email: ''\n    }\n  }<\/code><\/pre>\n\n\n\n<p>Next, we need to set that state in our button element.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">render(){\n    const { isDisabled } = this.state;\n    return(\n  &lt;div className=\"container\">\n  &lt;form>\n  &lt;div class=\"mb-3 col-md-6\">\n  &lt;label for=\"exampleFormControlInput1\" class=\"form-label\">Email address&lt;\/label>\n  &lt;input type=\"email\" class=\"form-control mb-4\" placeholder=\"name@example.com\" \/>\n  &lt;button disabled={isDisabled} type=\"button\" class=\"form-control btn btn-primary btn-lg\">Submit&lt;\/button>\n&lt;\/div>\n&lt;\/form>\n      &lt;\/div>\n    )\n  }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-create-a-function-that-gets-the-entered-value\">4. Create a Function that Gets the Entered Value<\/h2>\n\n\n\n<p>Finally, we&#8217;re going to create a function that gets the entered value and updates the state.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">  getValue = (e) => {\n    if(e.target.value === \"\"){\n      this.setState({ isDisabled: true })\n    }else {\n      this.setState({ isDisabled: false })\n    }\n  }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-full-code-here\">Full Code Here<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">import React, { Component } from 'react';\n\nclass App extends Component{\n\n  constructor(props){\n    super(props);\n    this.state = {\n      isDisabled: true,\n      email: ''\n    }\n  }\n\n  getValue = (e) => {\n    if(e.target.value === \"\"){\n      this.setState({ isDisabled: true })\n    }else {\n      this.setState({ isDisabled: false })\n    }\n  }\n\n  render(){\n    const { isDisabled } = this.state;\n    return(\n  &lt;div className=\"container\">\n  &lt;form>\n  &lt;div class=\"mb-3 col-md-6\">\n  &lt;label for=\"exampleFormControlInput1\" class=\"form-label\">Email address&lt;\/label>\n  &lt;input onChange={(e) => this.getValue(e)} type=\"email\" class=\"form-control mb-4\" placeholder=\"name@example.com\" \/>\n  &lt;button disabled={isDisabled} type=\"button\" class=\"form-control btn btn-primary btn-lg\">Submit&lt;\/button>\n&lt;\/div>\n&lt;\/form>\n      &lt;\/div>\n    )\n  }\n}\n\nexport default App;\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-result\">Result<\/h2>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"899\" style=\"aspect-ratio: 1440 \/ 899;\" width=\"1440\" controls src=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Screen-Recording-2023-08-12-at-3.36.57-AM.mov\"><\/video><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-buy-mobile-app-templates\">Buy Mobile App Templates<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/selar.co\/m\/origamisuite\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"902\" src=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/image.jpeg\" alt=\"\" class=\"wp-image-1421\" srcset=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/image.jpeg 800w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/image-266x300.jpeg 266w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/image-768x866.jpeg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In a React application, you can achieve the same functionality of disabling a button when an input is<\/p>\n","protected":false},"author":1,"featured_media":1420,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[73,98,95],"tags":[],"class_list":["post-1414","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react-js","category-softare-development","category-software-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Disable Button on Empty Input in React JS<\/title>\n<meta name=\"description\" content=\"Disable button on empty input in React JS. In a React application, you can achieve the same functionality of disabling a button when an input\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Disable Button on Empty Input in React JS\" \/>\n<meta property=\"og:description\" content=\"Disable button on empty input in React JS. In a React application, you can achieve the same functionality of disabling a button when an input\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/codeflretech\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-12T15:01:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-12T15:01:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"codeflare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codeflaretech\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/\"},\"author\":{\"name\":\"codeflare\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e65653d49add95629f8c1053c5cd76a\"},\"headline\":\"Disable Button on Empty Input in React JS\",\"datePublished\":\"2023-08-12T15:01:03+00:00\",\"dateModified\":\"2023-08-12T15:01:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/\"},\"wordCount\":184,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Untitled-Design-6.jpeg\",\"articleSection\":[\"react js\",\"softare development\",\"software development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/\",\"name\":\"Disable Button on Empty Input in React JS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Untitled-Design-6.jpeg\",\"datePublished\":\"2023-08-12T15:01:03+00:00\",\"dateModified\":\"2023-08-12T15:01:04+00:00\",\"description\":\"Disable button on empty input in React JS. In a React application, you can achieve the same functionality of disabling a button when an input\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#primaryimage\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Untitled-Design-6.jpeg\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Untitled-Design-6.jpeg\",\"width\":1200,\"height\":628,\"caption\":\"disable button in empty input in react js\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/disable-button-on-empty-input-in-react-js\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"softare development\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/softare-development\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Disable Button on Empty Input in React JS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"name\":\"\",\"description\":\"Sustainable solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\",\"name\":\"Codeflare Limited\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"width\":1040,\"height\":263,\"caption\":\"Codeflare Limited\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e65653d49add95629f8c1053c5cd76a\",\"name\":\"codeflare\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"caption\":\"codeflare\"},\"description\":\"Latest tech news and coding tips.\",\"sameAs\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\",\"https:\\\/\\\/facebook.com\\\/codeflretech\",\"https:\\\/\\\/instagram.com\\\/codeflaretech\",\"https:\\\/\\\/x.com\\\/codeflaretech\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCuBLtiYqsajHdqw0uyt7Ofw?sub_confirmation=1\"],\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/author\\\/watcher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Disable Button on Empty Input in React JS","description":"Disable button on empty input in React JS. In a React application, you can achieve the same functionality of disabling a button when an input","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/","og_locale":"en_US","og_type":"article","og_title":"Disable Button on Empty Input in React JS","og_description":"Disable button on empty input in React JS. In a React application, you can achieve the same functionality of disabling a button when an input","og_url":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/","article_author":"https:\/\/facebook.com\/codeflretech","article_published_time":"2023-08-12T15:01:03+00:00","article_modified_time":"2023-08-12T15:01:04+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg","type":"image\/jpeg"}],"author":"codeflare","twitter_card":"summary_large_image","twitter_creator":"@codeflaretech","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#article","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/"},"author":{"name":"codeflare","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/7e65653d49add95629f8c1053c5cd76a"},"headline":"Disable Button on Empty Input in React JS","datePublished":"2023-08-12T15:01:03+00:00","dateModified":"2023-08-12T15:01:04+00:00","mainEntityOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/"},"wordCount":184,"commentCount":0,"publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg","articleSection":["react js","softare development","software development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/","url":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/","name":"Disable Button on Empty Input in React JS","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#primaryimage"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg","datePublished":"2023-08-12T15:01:03+00:00","dateModified":"2023-08-12T15:01:04+00:00","description":"Disable button on empty input in React JS. In a React application, you can achieve the same functionality of disabling a button when an input","breadcrumb":{"@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#primaryimage","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg","width":1200,"height":628,"caption":"disable button in empty input in react js"},{"@type":"BreadcrumbList","@id":"https:\/\/codeflarelimited.com\/blog\/disable-button-on-empty-input-in-react-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codeflarelimited.com\/blog\/"},{"@type":"ListItem","position":2,"name":"softare development","item":"https:\/\/codeflarelimited.com\/blog\/softare-development\/"},{"@type":"ListItem","position":3,"name":"Disable Button on Empty Input in React JS"}]},{"@type":"WebSite","@id":"https:\/\/codeflarelimited.com\/blog\/#website","url":"https:\/\/codeflarelimited.com\/blog\/","name":"","description":"Sustainable solutions","publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codeflarelimited.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codeflarelimited.com\/blog\/#organization","name":"Codeflare Limited","url":"https:\/\/codeflarelimited.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","width":1040,"height":263,"caption":"Codeflare Limited"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/7e65653d49add95629f8c1053c5cd76a","name":"codeflare","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","caption":"codeflare"},"description":"Latest tech news and coding tips.","sameAs":["https:\/\/codeflarelimited.com\/blog","https:\/\/facebook.com\/codeflretech","https:\/\/instagram.com\/codeflaretech","https:\/\/x.com\/codeflaretech","https:\/\/www.youtube.com\/channel\/UCuBLtiYqsajHdqw0uyt7Ofw?sub_confirmation=1"],"url":"https:\/\/codeflarelimited.com\/blog\/author\/watcher\/"}]}},"jetpack_featured_media_url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2023\/08\/Untitled-Design-6.jpeg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/1414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/comments?post=1414"}],"version-history":[{"count":3,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/1414\/revisions"}],"predecessor-version":[{"id":1422,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/1414\/revisions\/1422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media\/1420"}],"wp:attachment":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media?parent=1414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/categories?post=1414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/tags?post=1414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}