logo
Tags down

shadow

Disable/Enable button when a value appears issue


By : chikuan kuong
Date : September 15 2020, 03:00 AM
To fix this issue I think code is right but don't know why you getting error, please try below code its work as expected. Hope it helps you.
code :
<div class="item form-group">
    <label for="ActuallOperationDate" class="control-label col-md-3">Actuall Operation Date</label>
    <div class="col-md-6 col-sm-6 col-xs-12">
        <input class="form-control col-md-7 col-xs-12" id="Actuall_Operation_Date" name="Actuall_Operation_Date" readonly />
    </div>
</div>
<button type="submit" value="Create" id="activeMe" class="btn btn-success" disabled>Submit</button>
function activeMe() {
    var ac_opDate = $('#Actuall_Operation_Date').val();

    if (ac_opDate != null && ac_opDate.length > 0) {
        $('#activeMe').prop('disabled', false);
        //document.getElementById("activeMe").disabled = true;
    }
    else {
        $('#activeMe').prop('disabled', true);
        // document.getElementById("activeMe").disabled = false;
    }
}


Share : facebook icon twitter icon

Enable/Disable click functions when the pop up appears


By : JTKear16
Date : March 29 2020, 07:55 AM
Hope that helps , Hey Try This Code to make model popup.
code :
<h3>JQuery Popup Dialogs</h3>

<input type="button" id="btnShowSimple" value="Simple Dialog" />
<input type="button" id="btnShowModal" value="Modal Dialog" />

<br /><br />       

<div id="output"></div>

<div id="overlay" class="web_dialog_overlay"></div>

<div id="dialog" class="web_dialog">
<table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
  <tr>
     <td class="web_dialog_title">Online Survey</td>
     <td class="web_dialog_title align_right">
        <a href="#" id="btnClose">Close</a>
     </td>
  </tr>
  <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
  </tr>
  <tr>
     <td colspan="2" style="padding-left: 15px;">
        <b>Choose your favorite mobile brand? </b>
     </td>
  </tr>
  <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
  </tr>
  <tr>
     <td colspan="2" style="padding-left: 15px;">
        <div id="brands">
           <input id="brand1" name="brand" type="radio" checked="checked" value="Nokia" /> Nokia
           <input id="brand2" name="brand" type="radio" value="Sony" /> Sony 
           <input id="brand3" name="brand" type="radio" value="Motorola" /> Motorola
        </div>
     </td>
  </tr>
  <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
  </tr>
  <tr>
     <td colspan="2" style="text-align: center;">
        <input id="btnSubmit" type="button" value="Submit" />
     </td>
  </tr>
  </table>
  </div>
(document).ready(function ()
 {
  $("#btnShowSimple").click(function (e)
  {
     ShowDialog(false);
     e.preventDefault();
  });

  $("#btnShowModal").click(function (e)
  {
     ShowDialog(true);
     e.preventDefault();
  });

  $("#btnClose").click(function (e)
  {
     HideDialog();
     e.preventDefault();
  });

  $("#btnSubmit").click(function (e)
  {
     var brand = $("#brands input:radio:checked").val();
     $("#output").html("<b>Your favorite mobile brand: </b>" + brand);
     HideDialog();
     e.preventDefault();
  });
  function ShowDialog(modal)
 {
  $("#overlay").show();
  $("#dialog").fadeIn(300);

  if (modal)
  {
     $("#overlay").unbind("click");
  }
  else
  {
     $("#overlay").click(function (e)
     {
        HideDialog();
     });
  }
 function HideDialog()
 {
  $("#overlay").hide();
  $("#dialog").fadeOut(300);
 } 

Enable or disable button based on radio button does not work in jQuery?


By : dadfshad
Date : March 29 2020, 07:55 AM
I wish this helpful for you I haven't any idea about asp but the question is about Jquery so May be I could help you
code :
<input type="radio" name="toggle" value="1">Toggle

<script type="text/javascript">

   $("input[name=toggle]").on('click', function() {
   var checked = $("input[name=toggle]").prop('checked');
  console.log(checked);
   if(checked) { $("#yourbtnId").show();  } 
  else { $("#yourbtnId").hide(); }
</script>
  $(function() {
        var checked = $("input[name=toggle]").prop('checked');
        console.log(checked);
        if(checked) { $("#yourbtnId").show();  } 
        else { $("#yourbtnId").hide(); }
  });

how to disable button for 3 seconds after button click and enable the button again


By : محمد الشهري
Date : March 29 2020, 07:55 AM
like below fixes the issue
how to disable button for 3 seconds after button click and enable the button again by itself?
code :
Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Button1.Enabled = False

    ' ... do something ...

    Await Task.Delay(3000)

    Button1.Enabled = True
End Sub
Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Button1.Enabled = False

    Await Task.Run(Sub()

                       ' ... do something ...

                       System.Threading.Thread.Sleep(3000)
                   End Sub)

    Button1.Enabled = True
End Sub

Disable Enable Submit button - Disable until all fields have values - HTML form check all inputs for answers


By : Kelly Xia
Date : March 29 2020, 07:55 AM
I wish this helpful for you There are multiple parts to disabling / enabling the save button:
Run code whenever a question is answered Disable / Enable Save button
code :
<form>
  <div  id= "select_input" name="select1">
    <select name="select1" onchange="areAllQuestionsAnswered()" required>
      <option disabled selected>Unidade:</option>
      <option>1</option>
      <option>2</option>
      </select>
   </div>

   <div class="input-field ">
     <textarea id= "text_input" name="text" class="materialize-textarea"
       data-length="500" onchange="areAllQuestionsAnswered()"></textarea>
     <label for="text">Long Text.</label>
   </div>

   <div class="input-field">
     <span class="gbp">
       <input id= "value_input" name="value" type="number" min="0"
       max="10000" step="0.05" onchange="areAllQuestionsAnswered()" required><br/>
       <label> value:</label>
     </span>
   </div>
</form>
<script>
  window.areAllQuestionsAnswered = function() {
    var allInputs,allDropDowns,allTextArea,
    arrayOfQuestions,i,j,L,L2,
    questionType,theseQuestions,
    thisQuestion,thisQstnType,thisValue;

    allInputs = document.getElementsByTagName("INPUT");
    allDropDowns = document.getElementsByTagName("SELECT");
    allTextArea = document.getElementsByTagName("TEXTAREA");

    arrayOfQuestions = [allInputs,allDropDowns,allTextArea];

    L = arrayOfQuestions.length;

    for (i=0;i<L;i++) {

      theseQuestions = arrayOfQuestions[i];

      L2 = theseQuestions.length;

      for (j=0;j<L2;j++) {
        thisQuestion = theseQuestions[j];
        thisQstnType = thisQuestion.type;

        if (thisQstnType === 'checkbox') {
          thisValue = thisQuestion.checked;
        } else {
          thisValue = thisQuestion.value;
        }

        if (!thisValue) {
          enableOrDisableSave(false);
          return;//Quit - one of the questions was not answered
        }
      }
    }

    enableOrDisableSave(true);//If the code gets here then all questions
        //were answered
  }

  window.enableOrDisableSave = function(enable) {
    var saveBtn;

    saveBtn = document.getElementById('put submit button id here');

    if (enable) {
      saveBtn.removeAttribute('disabled');//Enable the save button by removing the disable setting
    } else {
      saveBtn.setAttribute('disabled', 'disabled');//Disable the save button by
  //setting the attribute
    }

  }
</script>

I want to disable link button after clicking of it and other enable. toggle enable/ disable between both link buttons us


By : user3756679
Date : March 29 2020, 07:55 AM
Related Posts Related Posts :
  • Svelte 3 : array of children to parent communication via props
  • Using split to get only the URL without query string in javascript
  • How to ensure local-only transitions when Svelte is reusing the parent dom element
  • How to set object passed by reference to null?
  • Javascript isnt running well
  • Why my var is null and the code doesn't work
  • How to use Async with Angular8 firestore in ngOnInIt function?
  • How do I write a function starting with the keywork const - JavaScript?
  • JavaScript date conversion resulting in different values for Browser and Node js
  • How to automatically generate typescript interfaces for redux connected components
  • How to convert array containing a Symbol to string?
  • Performing a Promise.all with parameters
  • Fullcalendar day of the week three digit
  • How to call a dynamic function between components in Angular
  • javascript if else statement not working. It returns singleStory even if I click on the twoStory image. I have tried !=
  • Unable to make the trademark symbol bold using sup tags
  • How can I add properties to a component in a unit test before init?
  • Is it possible to create a cross dissolve with two divs?
  • NaN output when using reduce to add all elements in Array
  • Typescript decorator mess
  • How to escape internal css?
  • What does this export mean? Is this an object executing two functions?
  • How to Filter JSON.parse results
  • Calling 2 functions in an onchange input in reactjs and i face this error TypeError: Cannot read property 'target' of un
  • How to push to vue-router without adding to history?
  • JavaScript is not a function
  • How to add html element inside binding in nuxt or vue
  • React js state update issue
  • Using for loop in Express Router (node.js)
  • Best way to searching in an array of objects, based on given range in numbers
  • Check if array is not empty - XHR response test
  • issue with map (data structure) in this code
  • How can I give two different herf to ankle tag based in if-else
  • incorrect ajax url to controller function in Laravel framework
  • Get the <div> outside of this <div>
  • Finding if number exists in array
  • I can't fixed a problem of "Uncaught SyntaxError: Cannot use import statement outside a module"
  • React Router v4 not loading component
  • React multiple callbacks not updating the local state
  • How can I set the variable with firebase information
  • How to check if a vue object is empty in .vue using v-if
  • How to add ul with li by clicking event on a specific li using jQuery or JS
  • React useState when updating state twice, first update gets deleted
  • How to pass data between functional components in React?
  • How to iterate an object, that has sub arrays or objects with same property?
  • How to add filp efect to epub pages using Turn.js?
  • How to use model in javascript?
  • Google Cloud Function Error - PubSub to BigQuery
  • Why is my regex not splitting for '$$$' delimiter?
  • toggle inline styles with JQuery - display & overflow
  • Method that takes an array and moves all of the zeros to the end, preserving the order of the other elements
  • Angular how to change number value with leaving its origin value?
  • How to Log value of all cells in a column on google app scripts
  • How to overwrite CSS color scheme settings
  • "Uncaught SyntaxError: Cannot use import statement outside a module" When Importing ES6
  • JavaScript reassigning values is not working
  • Hide the word "followers" in Twitter's follow button
  • Passing data from dropdown => to javascript function (Google App script)
  • How to set autofocus on button inside modal everytime modal pops up?
  • How to get parent width/height in React using Hooks?
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk