in Education by
I made a form with an imput text and a select. To submit the form i want the user to click a verify button in order to check if all fields are correctly filed. If it is then the button submit who was initialy disabled is now enable. Here is the problem, i'd like that if the user modify anything in the form again then the button turn back to disable so that he must verify again to submit. To do so i'd like to find a jQuery event that triggers on any event on my form to turn back the submit button to disable again. Any idea of how could i do ? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can use the form (delegateTarget) then from that select the input types (https://stackoverflow.com/a/3165569/125981) that you wish to be in scope to attach event hanlders, and disable those desired by there type. Since it IS possible to have multiple I have included and example with two submit buttons that are and a reset button that is NOT disabled. To reverse that, you would need to have some way to clear them out so I added an example of a custom event. Added a reset event handler since it may come into play here. $('#myform').on('change keyup', 'input[type="text"], select', function(event) { $(event.delegateTarget).find('input[type="submit"]').each(function() { console.log("disable:", this); this.disabled = true; }); }) .on('all-clear', function(event) { $(event.delegateTarget).find('input[type="submit"]').each(function() { this.disabled = false; }); }) .on('click', '#allclear', function(event) { $(event.delegateTarget).trigger('all-clear'); }) .on('reset', function(event){ // do whatever is desired on the reset of the form }); .find('input[type="text"]').trigger('change'); //IF you want disabled initially Run code snippetExpand snippet

Related questions

0 votes
    I made a form with an imput text and a select. To submit the form i want the user to click a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    How can I sort an event by id in DESC order? My all events are coming and by default they are ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    How can I sort an event by id in DESC order? My all events are coming and by default they are ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm trying to make it so when a user scrolls down a page, click a link, do whatever it is they ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    I used the example from here http://jqueryui.com/demos/dialog/#animated to create a dialog box. The ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    Please refer to my test case https://jsfiddle.net/1c3Lmace/13/ This is my code $(document).ready( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have developed a website that queries NASA's image API. The website works fine on my desktop browser. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I have the following Javascript code which controls an accordion type set of divs. The set of divs is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I have a field as Image. I want to set it compulsory on button click event in javascript. Hereis ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I have loop inside loop like this: var len = bolumlerUnique.length; function bolumleriGonder() { for (i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    I have loop inside loop like this: var len = bolumlerUnique.length; function bolumleriGonder() { for (i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I have loop inside loop like this: var len = bolumlerUnique.length; function bolumleriGonder() { for (i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    Good afternoon. What happens that I want to get a text string with HTML tags, but the summernote interprets ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    So now I'm trying to customize Jquery steps by adding a score for each question's option. But the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    An alert should display anchor's zero-based index within a document instead of following the link. HTML: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
...